Welcome to WebmasterWorld Guest from 54.224.63.26

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Redirect to a New Folder

     
12:01 am on Jun 7, 2011 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 25, 2005
posts:392
votes: 0


I have dynamically generated URLs that need to be redirected to a new folder

Old URL
http://www.mydomain.com/oldfolder/?c=keywords+here


New URL
http://www.mydomain.com/newfolder/?c=keywords+here


How can I redirect Old URL to a New URL?
Note that the "
c=keywords+here
" part of the URL are dynamic, the only part that I want to change is the "
oldfolder
" to "
newfolder
"
12:23 am on June 7, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


What RewriteRule code have you tried? There's about 15 000 previous examples to guide.

The redirect is the LAST step in the process. The first step is that the links on your pages need to point to the right URL.

It is too late to "change" a URL after a link is clicked.

The redirect is there merely to encourage users and searchengines alike to update the URLs they have indexed.
12:40 am on June 7, 2011 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 25, 2005
posts:392
votes: 0


Im transferring the "oldfolder" to the "newfolder", and soon will delete the oldfolder, so anyone who have bookmarked the oldfolder will be redirected to the newfolder, but preserving the other part of the URL like the query string.
12:42 am on June 7, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


Yes, just one line of code should get that job done.

RewriteRule ^old-path http://www.example.com/new-path [R=301,L]


Query strings data is automatically re-appended.