Forum Moderators: phranque
I am renaming directories from very long and bady formed names (with spaces in them) to more specific and shorter names.
So I need a redirect for an entire directory.
Looking through the posts here it seems that something like
rewriteRule ^/"whatever I have"/(.*)$ http://www.example.com/whatever-i-have/$1 [R=301,L]
might work ... but doesn't
Sounds lame - but can someone correct my syntax. Where do the "" go?
also - do I create the new directory with the shortest possible name? or include some keywords in the directory name?
eg
www.example.com/keyword-name-directory/filename.htm
Google seems to highlight these words in search results. Or is this spurious?
Thanks for all here (as always)
bryan
[edited by: jdMorgan at 12:12 am (utc) on June 5, 2007]
[edit reason] example.com [/edit]
Using simple redirect 301 instead of mod rewrite
redirect 301 "/whatever I Have/" http://www.example.com/whatever-i-have/
seems to work OK - much simpler - why would we use mod rewrite for this (as seen in previous posts)? of have I short circuited something
Bryan
[edited by: jdMorgan at 12:13 am (utc) on June 5, 2007]
[edit reason] example.com [/edit]
Using simple redirect 301 instead of mod rewrite
redirect 301 "/whatever I Have/" http://www.example.com/whatever-i-have/
seems to work OK - much simpler - why would we use mod rewrite for this (as seen in previous posts)? of have I short circuited something
Bryan
[edited by: jdMorgan at 12:13 am (utc) on June 5, 2007]
[edit reason] example.com [/edit]
So, if it works on your current server and you don't plan to change hosting companies, it's OK.
Jim