Need help to create 301 dynamic redirect urls

Discussions about Apache mod Rewrite, .htaccess, Use, experiences ... URL Rewriting.

Moderator: Moderators

Need help to create 301 dynamic redirect urls

Postby jennypretty » Fri Mar 22, 2013 6:52 pm

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!
jennypretty
 
Posts: 2
Joined: Sun Dec 07, 2008 2:40 pm

Advertisement

Re: Need help to create 301 dynamic redirect urls

Postby dcz » Thu Apr 04, 2013 7:24 am

Code: Select all
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^dating/united_states_singles/?(.*) http://www.yourdomain.tld/free-dating/united_states/$1 [QSA,L,R=301]


Assuming you delete the physical directory (if any) dating/united_states_singles/ and put, this in a .htaccess at the domain's root (where -www.yourdomain.tld lands on the server).
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21428
Joined: Fri Apr 28, 2006 9:03 pm


Return to Apache mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest