Remove .html extension 01-10-2014, 12:46 PM
#1
Hey guys,
I am busing developing a website for a music group and I am having a few problems.
I am trying to eliminate the .html extension at the end of the URL so it looks clean and fresh.
I searched around and I got a .htaccess code to help me however it's still not working.
I then change the a href tag as instructed
But nothing happens apart from the server not being able to read the page (obviously)
and just gives me a 404 page (error)
I believe my hosting DOES allow .htaccess which editing is compatible,
does anyone have any suggestions?
Would be a major help,
thanks Ryazz.
I am busing developing a website for a music group and I am having a few problems.
I am trying to eliminate the .html extension at the end of the URL so it looks clean and fresh.
Quote:http://www.example.com/home.html
to > http://www.example.com/home
I searched around and I got a .htaccess code to help me however it's still not working.
Code:
.htaccess code
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ /$1 [L,R=301]I then change the a href tag as instructed
Code:
Before: <a href="/home.html">Home</a>
After: <a href="/home">Home</a>
I even ttied <a href="http://www.example.com/home"</a>But nothing happens apart from the server not being able to read the page (obviously)
and just gives me a 404 page (error)
I believe my hosting DOES allow .htaccess which editing is compatible,
does anyone have any suggestions?
Would be a major help,
thanks Ryazz.
-- Back from the dead! --
I just help people and fuck around with released programs, so.
-- White Hat Hacking --
I just help people and fuck around with released programs, so.
-- White Hat Hacking --




![[+]](https://sinister.li/images/modern/collapse_collapsed.png)