Forum Moderators: phranque

Message Too Old, No Replies

Using .htaccess to rewrite external links

         

zorafex

7:50 pm on Jun 22, 2003 (gmt 0)

10+ Year Member



Would it be possible to use mod_rewrite to rewrite all external links on my site? For example if I have this link:

<a href="http://yahoo.com">Yahoo.com</a> could mod_rewrite change it to:
[myserver.com...]

Is this possible? I really need something like this, because I wont dare try to change all links on my site manually :/

jdMorgan

7:59 pm on Jun 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



zorafex,

Welcome to WebmasterWorld [webmasterworld.com]!

No, because your .htaccess won't be invoked when a user clicks on your yahoo link.

You might want to look into multi-file search and replace freeware/shareware editors.

If you have an internal link, you can rewrite that to an external link - many people use this technique to track clicks on their outgoing links. But it won't work the other way around. In order to invoke .htaccess, the link has to result in a request to your site.

Jim