LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG-Webdev] mod_rewrite help!

[ILUG-Webdev] mod_rewrite help!

Donncha O Caoimh donncha.ocaoimh at tradesignals.com
Thu Mar 6 14:28:44 GMT 2003


I'm updating blogs.linux.ie with the code from the release on Sunday, but I'm 
running into problems with mod_rewrite that worked fine at home on a Red Hat 
8.0 box that now don't work on Debian.

I have the following in the .htaccess
RewriteEngine on
RewriteRule ^(.*)b2-img/(.*) b2-img/$2 [L]  # b2 images
RewriteRule ^templates/(.*) users/root/templates/$1 [L]  # default template
RewriteRule ^(.*)templates/(.*) users/$1/templates/$2 [L]  # user templates
RewriteRule .* PATH/redirect.php [L]  # generic redirect handler

The word PATH gets replaced by the filesystem path to that file when 
installing. 
What this does:
If you request http://blogs.linux.ie/xeer/b2-img/xml.gif it actually sends 
http://blogs.linux.ie/b2-img/xml.gif to you.
If you request http://blogs.linux.ie/xeer/templates/site.css it'll send 
http://blogs.linux.ie/users/xeer/templates/site.css to you instead.
If you request http://blogs.linux.ie/templates/site.css it'll send 
http://blogs.linux.ie/users/root/templates/site.css to you instead.

Otherwise, it feeds every other request to redirect.php
I tried the above code on blogs.linux.ie but the browser just kept loading. 
(and now there's lots of apache processes stuck/running, damn..)

When I put the path in front of "b2-img/$2 [L]" I was able to view images in 
there, but when I did the same for templates it didn't work.

Anyone know how to fix this?

Donncha.


More information about the Webdev mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell