mod_rewrite help
Posted: Sun Sep 11, 2005 3:41 pm
Hello everyone,
I'm having difficulty wrapping my head around mod_rewrite for my home-rolled gallery script. I'm on a shared host, so all my web-viewable files are in the /home/my_user/public_html/ directory. I've got a sub-directory of that called browser. I want to put some .htaccess restrictions on that directory, so that a call to http://www.mydomain.ca/browser/Camping/Card1 will actually point to http://www.mydomain.ca/browser/index.ph ... ping/Card1.
I thought I had it figured out with this file:
But that doesn't work - likely because I'm stabbing in the dark. I have a few questions still.
I'm having difficulty wrapping my head around mod_rewrite for my home-rolled gallery script. I'm on a shared host, so all my web-viewable files are in the /home/my_user/public_html/ directory. I've got a sub-directory of that called browser. I want to put some .htaccess restrictions on that directory, so that a call to http://www.mydomain.ca/browser/Camping/Card1 will actually point to http://www.mydomain.ca/browser/index.ph ... ping/Card1.
I thought I had it figured out with this file:
Code: Select all
RewriteEngine on
RewriteBase /browser/
RewriteRule ^/(.*)$ http://www.mydomain.ca/browser/test.php?path=$1 [R,L]- What exactly does RewriteBase do? From what I've read, that's the subdirectory where the RewriteRule starts its work. If I've got the .htaccess file sitting in /home/my_user/public_html/browser/, what should I have for the RewriteBase?
- Is that regex going to work?