homepage Welcome to WebmasterWorld Guest from 54.205.7.136
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Redirect to a New Folder
Gian04




msg:4322679
 12:01 am on Jun 7, 2011 (gmt 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"

 

g1smd




msg:4322682
 12:23 am on Jun 7, 2011 (gmt 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.

Gian04




msg:4322698
 12:40 am on Jun 7, 2011 (gmt 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.

g1smd




msg:4322701
 12:42 am on Jun 7, 2011 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved