Forum Moderators: phranque
I have an urgent directive to shift all content from our present server to our new server. Although all the filenames (dynamic url's) would remain the same, but the folder location is changing (universally) across the board. Here's the scenario:
At present, the url's are like: http://example.com/portal/modules.php?name=01e_page_title
What we need now is:
http://example.com/modules.php?name=01e_page_title
so, each query string that appears as a part of url containing /portal/ after companyname.com would remain the same, except that /portal/ folder would vanish.
Is there some way to write just one universal command to accomplish this using Redirect 301?
With best wishes
JLS
[edited by: jatar_k at 9:01 pm (utc) on July 6, 2006]
[edit reason] examplified [/edit]
You don't even need to worry about the query string -- mod_rewrite's default handling of query strings is to leave them unchanged and simply pass them through the rewrite operation.
You will have to change all the page-generation code to stop putting /portal/ in the on-page links, since those are the links that people will click on and that robots will "see," but the simple mod_rewrite described above will take care of the pre-existing backlinks.
Jim