#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    3
    Rep Power
    0

    Redirection of the links in the page using Apache


    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/somequery

    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.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    3
    Rep Power
    0
    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...">
  4. #3
  5. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,965
    Rep Power
    9397
    I assume you own both oldURL.com and newURL.com, right?

    You have to be more specific about what you're redirecting.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    3
    Rep Power
    0
    Hi. I do own both domains.

    Is there a way to set in apache:

    if the domain is newUrl.com

    that all the links in the page like

    <a href= oldUrl.com/1...>

    redirect or rewrite to

    <a href = newUrl.com/1 ...>

    but if the domain is oldUrl.com, they stay untouched.

IMN logo majestic logo threadwatch logo seochat tools logo