.htaccess - RedirectPermanent on localhost without contacting other domains -


lets says have .htaccess file following apache redirect webbrowsers specifik iconfile.

redirectpermanent /favicon.ico http://example.com/folder/icon.ico 

so guess when test website on localhost every time browser looking http://localhost/favicon.ico gets send http://example.com/folder/icon.ico

how avoid this?

on localhost redirect http://localhost/folder/icon.ico like:

redirectpermanent /favicon.ico http://localhost/folder/icon.ico 

what correct/optimal way solve problem.

your problem mod-alias not flexible use variables should use mod-rewrite.

not sure why want anyway, can try this.

rewriteengine on rewriterule ^favicon.ico$ http://%{http_host}/folder/icon.ico [r=301,l] 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -