Forums

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

Home Forums Back End remove html and/or PHP extensions in URL

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #25538
    todd
    Member

    Does anyone know how to remove the .html or .php extensions from appearing in the URL? My example would be like (before) http://www.testing/remove.html to (after) http://www.testing/remove
    I searched Chris’s site and this forum, I could not find an answer, unless I overlooked it. I did not know if anyone out here was familiar with this or not? I researched the web, I know this requires coding in the .htaccess.txt file. However, some of the example codes I tried never worked for some reason.

    One example code:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME}!-d
    RewriteCond %{REQUEST_FILENAME}!-f
    RewriteRule ^([^.]+).php$ $1 [L]

    Two of my PHP books, do not even mention this?

    Any help would be appreciated!

    Sincerely,
    Todd

    #61461
    Chris Coyier
    Keymaster

    Just to make sure the obvious is covered here….

    You could create a directory called "remove" in your root directory and put an index.html file inside of that and you’d have /remove/ working no problem.

    #61478
    todd
    Member

    Chris, you know I did’nt even think about creating a directory. I will try that that. Thanks for the replies everyone!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.