Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirection of the links in the page using Apache

Status
Not open for further replies.

grapeseed

Programmer
Sep 15, 2013
4
0
0
RS
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=" w w.oldURL.com/somethingfoo...">

To be rewritten or redirected to:

<a href=" 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.
 
Thanks, I havent, I'll get into it.

I want this redirection of links in the page to happen only when w w w.newURL.com/somequery is accessed, but not to happen with the old w w w.oldURL.com/somequery.
 
Use relative URLs in the links NOT absolute URLs.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Thanks Hirst.

Ive tried RedirectMatch, but it must be conditional, to redirect/rewrite links <a href = oldURL.com/...> to <a href = newURL.com/...> only if the domain of the page is newURL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top