Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Redirection of the links in the page using Apache |
|
Author |
|
admin Site Admin
Joined: 15 Oct 2005 Posts: 692
|
Posted: Sun 15 Sep '13 20:30 Post subject: Redirection of the links in the page using Apache |
|
|
Restored posts from grapeseed
I am trying to do URL redirection like this using Apache on CentOS:
w w w.newURL.com/somequery
To display the content of the page
w w w.oldURL.com/somequery
Except that all of the links in that page like:
<a href="http://w w w.oldURL.com/somethingfoo...">
To be rewritten or redirected to:
<a href="http://w w w.newURL.com/somethingfoo...">
But, when the old adress is accessed
w w w.oldURL.com/page.jsp
those links in the page should not be changed.
Can someone tell me step by step all the things I need to do, because I'm a beginner in Apache configuration.
Or, in other words:
I want to do the following redirection:
If I have a page with address w w w.oldURL.com/somequery
and with content like:
SomeContent1
<a href="http://w w w.oldURL.com/something1...">
<a href="http://w w w.oldURL.com/something1...">
<a href="http://w w w.oldURL.com/something3...">
I want to do redirection from address w w w.newURL.com/somequery
to display the same content, except with those links changed:
SomeContent1
<a href="http://w w w.newURL.com/something1...">
<a href="http://w w w.newURL.com/something1...">
<a href="http://w w w.newURL.com/something3..."> |
|
Back to top |
|
admin Site Admin
Joined: 15 Oct 2005 Posts: 692
|
Posted: Sun 15 Sep '13 20:32 Post subject: |
|
|
Restored Post from James Blond:
on the old server:
Code: |
RewriteEngine On
RewriteRule (.*) http://www.newserver.com/%{REQUEST_URI}
|
|
|
Back to top |
|
|
|
|
|
|