Tag Archive for dynamic url redirect

Dynamic URL redirect within particular subdomain using .htaccess

Share

Below are the lines you need to add in your .htaccess file to redirect /services/blahblah URLs to /offerings/blahblah for the sub domain mentioned in line 1 below (en.domainnamegoeshere.com). Dynamic URL redirect.

RewriteCond %{HTTP_HOST} ^en.domainnamegoeshere.com$
RewriteRule ^services/(.*)$ http://en.domainnamegoeshere.com/offerings/$1 [R=301,L]

Above lines will redirect all the URLs in pattern below.

Redirects
http://en.domainnamegoeshere.com/services/web
to
http://en.domainnamegoeshere.com/offerings/web

This will NOT redirect similar URLs in OTHER sub domains of your site except en.domainnamegoeshere.com.
Read more

Sharing is cool...Share on Facebook
Facebook
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin
2,011 views