Really really basic htaccess question

software development


I’m just starting out with .htaccess and ive been struck what is probably a really basic problem. :slight_smile:

I have the .htaccess file in the site directory (the same level as that site’s index file) and just to make sure i could do the right thing I wrote this thing I wrote

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)w/$ $1v/ [R]

thinking it will take “” and go to “” It actually goes to “

which is not what I expected at all.

is there something wrong with the basic ideas of my regex? do i need more in my .htaccess file? is its placement wrong?

Thanks in advance for your assistance.



Options FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^(.*)w/$ $1v/ [R]The RewriteBase tells mod_rewrite the base url-path prefix to reinsert. Also, there is no leading / in the URL when you get to RewriteRule:

URL = w/

$1 = (null)

Substitution = v/

oops, v/ is not a URL. So it had to make it a URL, but we don’t have a base so we use the document root instead, /home/username/domain/

:cool: -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7