Air

msg:4051187 | 3:43 am on Dec 30, 2009 (gmt 0) |
make the necessary substitutions to directory, and domain, should work; RewriteEngine ON RewriteCond %{REQUEST_URI} !^/?directory RewriteRule ^(.+)?$ http://example.com/directory/$1 [QSA,R=301]
|
g1smd

msg:4051273 | 8:22 am on Dec 30, 2009 (gmt 0) |
QSA is implied anyway. Omit it. You need to add [L] always.
|
Excalibur

msg:4061249 | 9:12 am on Jan 15, 2010 (gmt 0) |
It worked great, thank you guys.
|
jdMorgan

msg:4061505 | 5:20 pm on Jan 15, 2010 (gmt 0) |
A remaining question is whether you actually wanted a redirect, which exposes the new filepath as a URL to the client (and forces all the search engines to toss all your old URLs), or whether you simply want to move the files that those old URLs correspond to into a sub-directory, changing where the 'content' for those old URLs is stored, but not changing the URLs themselves. If that's the case, then you want an internal rewrite, not an external redirect, and the code will need to be tweaked. Jim
|
Excalibur

msg:4061537 | 6:07 pm on Jan 15, 2010 (gmt 0) |
Jim, I wanted an internal rewrite actually. And it worked (you gave me a great code in a previous post). But having the internal rewrite & that old code together didn't work. And the new website has new contents, so what the search engines have will be different from what is there now anyway. However, if you have a better solution, it would be so great to share it.
|
jdMorgan

msg:4061563 | 6:45 pm on Jan 15, 2010 (gmt 0) |
The usual problem when 'new code' doesn't work with 'old code' is that the new code has been inserted in the wrong place. See this concurrent thread, and look for the list I posted showing mod_rewrite rule-ordering [webmasterworld.com]. Jim
|
Excalibur

msg:4061570 | 6:53 pm on Jan 15, 2010 (gmt 0) |
Jim, Thanks again for the resource. I should take my time reading & trying things out. If I happen to not get it done properly, I shall ask again. Thank you very much. --Ex
|
|