Forums

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

Home Forums Back End How do I remove the html from /contact.html?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #35053

    I don’t like the look of my address bar on my website when it says for example, /contact.html. Now I have no idea how to use .htaccess and php worked quiet well for me in other things, so if you know how to do it in php please respond. Or if you can tell me how to use .htaccess that would be cool!

    #90226
    chrisburton
    Participant
    RewriteRule ^contact$ contact.html [L]
    #90237
    joelmb
    Member
    RewriteRule ^([^.]+)$ $1.html [NC,L]
    #90239
    chrisburton
    Participant

    @joelmb has the better solution which removes ALL of the .html extensions from your URL.

    #90563

    @joelmb What if you have a .php file and a .html files in the same directory? How can you use the same .htaccess file?

    #90575
    mattgoucher
    Member

    RewriteRule ^([^/]+).php/(.*)$ /$1/$2 [NE,R=301,L,NC]
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Back End’ is closed to new topics and replies.