Hi All i have a problem that my file have .html extention but i want that when the file open in brownser the extention had hidden.e.g file.html to file. Advance thanks
4 Answers
In your .htaccess file use this:
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^(.*)$ $1.html Now you can use lins like http://www.mysite.com/contact rather than http://www.mysite.com/contact.html.
Hope this helps!
3 Comments
user716987
thanks but problem is that they show the contact page in browser but when i write in browser contact.html here extentionshow till refreshing the page.
ThisDarkTao
I read up to contact.html and you've lost me. What is it you're trying to do?
user716987
make a page contact.html and write the .htaccess and past the above code in .htaccess.now file open in browser they will show you contact but problem is that when you write the .html with contact page in browser then extention is showing but i want extention will no show if i write the .html extention in browser then page no expect this extention .see this link myatlantainjurylawyer.com
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/$ $1.php RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$ RewriteRule (.*)$ /$1/ [R=301,L] Example yoursite.com/wallpaper.html to yoursite.com/wallpaper/