0

I have to manage a huge web site which has coded with absolute paths like:

<a href='http://www.samewebsite.net/anotherPage.cfm'>link to another page in the site.</a>

Now, as I previously said, the web site has many pages and I'm not paid for changing manually all the absolute URLs into relatives. Someone suggested me to try use the mod_rewrite Apache to get rid of them. I checked Apache docs and tried this:

RewriteEngine On
RewriteRule www.samewebsite.net localhost

but it doesn't work nor in .htaccess file nor in httpd.conf inside the VirtualHost directive. I guess it's a matter of regexpressions, but I'm not sure of it. How can i solve this?

Thank you.

IssamTP
  • 175
  • 3
  • 12
  • Can you explain what exactly you are typing into your address bar, and what you EXPECT to happen? Your question is very obscure. – Andrew M. Nov 19 '10 at 13:03
  • The problem is that all of the links in the website are hardcoded with absolute Internet path. So, let's say that you are in pageA.html and you want to go to pageB.html by clicking an hyperref, normally you'd type: page two, n this site indeed: page two. I'd like that Apache forward these request into: page two. – IssamTP Nov 19 '10 at 15:27

1 Answers1

0

Mod_rewrite will not change your HTML. You need an output filter http://httpd.apache.org/docs/2.2/mod/mod_ext_filter.html

I'm not paid for changing manually all the absolute URLs into relatives.

Manually? Why not write a simple script?

Mark Wagner
  • 17,764
  • 2
  • 30
  • 47