homepage Welcome to WebmasterWorld Guest from 54.167.138.53
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Need help to create 301 dynamic redirect urls
jennypretty




msg:4557538
 6:39 pm on Mar 22, 2013 (gmt 0)

Hello,

I have one question about is it possible to create dynamic 301 redirect urls.

I have a dating site and the url format is like /dating/united_states_singles/. A few months ago, I changed it to /free-dating/united_states/ (added free and removed singles). When I checked on Google webmaster tool, both URLs (old and new) are indexed, which create duplicate title and description tags.

Is it possible to create 301 redirect for all old urls to new urls format?

Thanks very much!
Have a nice day!

 

phranque




msg:4557541
 6:50 pm on Mar 22, 2013 (gmt 0)

welcome to WebmasterWorld, jennypretty!

it depends on if and how you can identify and define the pattern of the old urls translating to the new urls.

if:
- all the old urls to be changed start with /dating/
- all the new urls start with /free-dating/
- all the old urls to be changed end with country_name_singles/
- all the new urls end with country_name/
then the answer is yes, you can do this with a single mod_rewrite directive using RewriteRule using capture groups in the pattern and backreferences in the substitution string.

if there's more going on than i assumed above then you will have to provide a comprehensive problem description.

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