I have a website and I have a parked domain on top of it now. The problem is after the visitors log into the site using eg. example.org... after clicking on any link in the site it takes them back to http://example.com/articles/fitness_training/.
How can I keep the parked domain extension from changing in all the urls.. so that when I'm browsing with example.org all my links stay at example.org and vice versa...
I know htaccess can do this, but can't get the correct htaccess directive to do this.
Any help would be appreciated on this...
htaccess can't do this, it sounds like the links in your content point to example.com
, so you need to change your links. You can remove the http://example.com
part so that it just says /articles/fitness_training/
and it'll stop going to the other site.
What htaccess can do for you is to redirect any requests for example.com
to example.org
:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC]
RewriteRule ^(.*)$ http://example.org/$1 [L,R=301]
But that means every time someone loads an image, clicks a link, etc, they're hitting your website twice.
The only other thing you can do with htaccess is to use something like mod_proxy_html which will filter all outgoing content and you can change links dynamically that way.