I have an already online hosted website which I have downloaded and configured for wamp. The only problem which occurred is that if I click on any link on my local website I will get redirected to my online website.
Unfornutally I cannot set up my htaccess so that it's changing the online links to the local server.
So for instance:
Having a link on a site which redirects to www.example.com/blog
should be rewritten to redirect to example.dev/blog
.
For that I have tried something like that:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com(.*) [NC]
RewriteRule ^(.*)$ example.dev/$1 [R=301,L]
But it does not work.
EDIT: A more in depth example:
I have a website which address is: www.example.com
its local wamp address is example.dev
. Now I have a link <a href="http://www.example.com/shop.html">Shop</a>
within a index.html of the local example.dev
root. And now I need a way to redirect http://www.example.com/shop.html
to http://example.dev/shop.html
. This should be apply to all sub pages not only for shop. Also for style sheets etc.