Gossamer Forum
Home : General : Internet Technologies :

mod rewrite for external links

Quote Reply
mod rewrite for external links

I guess it is not but was wondering if it might be possible to do some kind of mod rewrite for external links.
The problem is: I have pdf-documents with links to the next page. While using them offline it works with relative paths but as soon as I have them uploaded they try to find the next page on the original server. So it would help if all requests for http://www.otherdomain.com/page5.html would be rewritten to http://mydomain.com/page5.html.

Has anyone an idea how to do that?


n || i k o

Last edited by:

el noe: Feb 28, 2004, 6:35 AM
Quote Reply
Re: [el noe] mod rewrite for external links In reply to
Dunno... give this a go (in a .htaccess file, located in your root folder for the site...i.e where index.html would be kept);

RewriteEngine On
RewriteRule (.*) http://www.otherdomain.com/$1 [L]

That *should* redirect people from http://www.yourdomain.com/test/index.html to http://www.otherdomain.com/test/index.html (or whatever page you are requesting).

I'm not good at mod_rewrite. This is just a re-write of something Alex posted once, but it should work :)


Andy (mod)
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] mod rewrite for external links In reply to
Hi Andy,

thank you for your reply. I think this is a good idea but probably it won´t work. I think there is no chance to interfere with rewrite rules and a leaving link... stupid files they are or am I.

Thanks again

n || i k o