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

.htaccess Help

Discussion in 'White Hat SEO' started by NovaflareFX, May 22, 2015.

  1. NovaflareFX

    NovaflareFX Jr. VIP Jr. VIP

    Joined:
    Dec 13, 2014
    Messages:
    346
    Likes Received:
    92
    Occupation:
    Twitch Gamer
    Location:
    London
    Hey All,

    I am totally stuck with this .htaccess, I am trying to do the following:



    • In addition, the site is HTML, so i'm trying to hide the '.html' part, current, it comes up as 'www.example.com/page.html'
    • Also, 301 redirect any broken links to the homepage
    • Lastly, how can I redirect 'example.com/old-page.html' to 'example.com/new-page.html'
     
  2. redarrow

    redarrow Elite Member

    Joined:
    Apr 1, 2013
    Messages:
    4,267
    Likes Received:
    976
  3. NovaflareFX

    NovaflareFX Jr. VIP Jr. VIP

    Joined:
    Dec 13, 2014
    Messages:
    346
    Likes Received:
    92
    Occupation:
    Twitch Gamer
    Location:
    London
    Thank you very much, just for anybody else that is stuck, I used the below:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^https://www.example.co.uk[nc]
    RewriteRule ^(.*)$ http://www.https://www.example.co.uk/$1 [r=301,nc]