Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Change the link in a href string

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #239840
    jerryr125
    Participant

    Hi
    As a wordpress page loads, I would like to change and references
    of (example)
    http://www.abc123.net/old/

    to

    http://www.abc123.net/new/

    So basically I would like to change any occurrence of /old/ to /new/ within a URL string on the pages.

    How do you do that ?

    #239841
    jerryr125
    Participant

    Or when
    http://www.abc123.net/old/
    redirect to
    http://www.abc123.net/new/

    (this method might even be better!)

    #239844
    Senff
    Participant

    ( topic moved to “Other discussions” )

    To redirect, you should use 301 redirects in your .htaccess file.

    Redirect 301 /old /new
    

    Or, if that doesn’t work:

    RewriteEngine On
    RewriteRule ^/?old/(.*)$ /new/$1 [L,R=301]
    
    #239845
    jerryr125
    Participant

    What about something using JavaScript or php ?

    Not sure if that will work since I cannot access that file

    #239847
    Shikkediel
    Participant

    Never mind…

    #239848
    jerryr125
    Participant

    Hi
    Is there a way to redirect the URL to a different page on the site ?
    That is if some goes to the URL it redirects them to a new URL ?

    #239851
    jerryr125
    Participant

    using a wordpress plugin- all set – thank you :)

    #239852
    Shikkediel
    Participant

    I was getting a bit confused myself if this was about redirecting an entire page or adjusting an external link on that page…

    Maybe sharing that particular plugin could help other readers in the future.

    #239853
    jerryr125
    Participant
Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Other’ is closed to new topics and replies.