Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect Directory on One Domain to Subdomain on Different Domain

Status
Not open for further replies.

MrTBC

Technical User
Nov 19, 2003
610
US
I need to redirect all URLS relating to a subdirectory on one domain to a subdomain on another domain, e.g.


Should be redirected to:


This needs to work for:

etc.

Please note that the directory needs to be removed from the first domain and the subdomain needs to be added to the second domain.

Can this be achieved using .htaccess please?

Thanks very much for your help.
 
Could it be that your CMS system is doing additional redirects or logic after you reach it? Have you verified that you can manually create the redirect URL and access it on subdomain.domaintwo.com?

Can you send some exact examples (you can substitute the domains names for privacy) with the request URL and the target URL for the redirect?

Thanks,

Rob

Rob Jordan
 
I'd suggest redirecting to somewhere else as a test. That way you will be able to test the redirect in the browser without CMS possibly acting on the request.

Here's an example where I am redirecting to google.

<VirtualHost *>
ServerName <Location />
Allow from all
</Location>
RewriteEngine on
RewriteRule ^/directory/(.*) [R=301,L]
</VirtualHost>

So redirects me to
Rob

Rob Jordan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top