.htaccess - HTACCESS RewriteCond on multiple domains -


i'm trying setup htaccess rewrite rule ignores .co.uk index.

so example, if goto www.mydomain.co.uk/mypage redirects www.mydomain.com/mypage

however if goto www.mydomain.co.uk stays on www.mydomain.co.uk, hit inner page redirects .com address.

if user comes in on www.mydomain.com stay on .com domain

any appreciated.

try adding these rules htaccess file in document root of www.mydomain.co.uk domain:

rewriteengine on rewritecond %{http_host} ^(www\.)?mydomain\.co\.uk$ [nc] rewritecond %{request_uri} !^/(index\.(html?|php))?$ rewriterule ^(.*)$ http://www.mydomain.com/$1 [l,r=301] 

if don't want permanent redirect, remove =301 part rule's flag.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -