1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to create permanent redirect on HTML/CSS/PHP site?

Discussion in 'Web Design' started by Scorpion Ghost, Sep 1, 2016.

  1. Scorpion Ghost

    Scorpion Ghost Senior Member

    Joined:
    Mar 22, 2013
    Messages:
    1,120
    Likes Received:
    265
    Occupation:
    Internet!
    Location:
    On the Interwebz
    I have site that is created with HTML, CSS and some basic PHP.

    It's not wordpress or woo commerce or anything like that. It's just a basic simple template.

    Well, I had some pages on my sites, and recently I changed the URLs on them. And now all of my old links lead to my site but on like a broken page. So I want to somehow create redirects (I think I need the 301 permanent redirects in order to keep link juice flowing and all that)

    Can anyone advise me on the most current/latest way to do this so that my users are redirected properly and the search engines find it acceptable?

    p.s each page on my site is its own php file. It's a bitch to edit things across the entire site, but it is what it is.

    Thanks
     
  2. fanatik1389

    fanatik1389 Regular Member

    Joined:
    Apr 7, 2014
    Messages:
    302
    Likes Received:
    109
    All you need is .htaccess 301 redirects.
    Plenty of tutorials and tools out there. For example this: http://www.htaccessredirect.net/

    Get a list of all pages you want redirected and do 301 for all of them.

    You might be able to save some time if there is a pattern for new URLs. In that case you could create one rule and not have to go through trouble of doing all pages one by one.

    Or you can do php redirects. I prefer .htaccess, but that's just me... :)
     
  3. Scorpion Ghost

    Scorpion Ghost Senior Member

    Joined:
    Mar 22, 2013
    Messages:
    1,120
    Likes Received:
    265
    Occupation:
    Internet!
    Location:
    On the Interwebz
    I tried. But I messed it up. It just made the page be a 500 error.

    And I tried something else from some tutorial I found online too, which also didn't work.

    This is confusing as fuck to me.
     
  4. tasburrfoot

    tasburrfoot Regular Member

    Joined:
    Dec 16, 2008
    Messages:
    323
    Likes Received:
    152
    If the broken links are 404ing you can redirect all 404 to your index using htaccess. Alternatively, if you're not to familiar with that kind of tinkering and don't want to break things your website cPanel should have a redirect section, or somewhere you can modify your 404 page