I am not sure if you would do this in the .htacess file but,
I have a page www.website.com/page2.html
How would I make the URL look like www.website.com/page2
I am not sure if you would do this in the .htacess file but,
I have a page www.website.com/page2.html
How would I make the URL look like www.website.com/page2
With .htaccess under apache you can do the redirect like this:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ /$1 [L,R=301]
As for removing of .html from the url, simply link to the page without .html
<a href="http://www.website.com/page2">page</a>
This should work for you:
example.com/page
will display the contents of example.com/page.html
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ $1.html [L,QSA]
</IfModule>
301 from example.com/page.html
to example.com/page
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.html\ HTTP/
RewriteRule ^(.*)\.html$ /$1 [R=301,L]
</IfModule>