HOME BLOG PORTFOLIO PHOTO CONTACT Admin Login
code to hide your page extension from url

.htaccess code to hide your page extension from url
like-> http://localhost/jay/seo/hideExtension/index2 (not http://localhost/jay/seo/hideExtension/index2.html)
run method:
[1]. Make a directory structure like this : C:wampwwwjayseohideExtension
[2]. Make a file inside C:wampwwwjayseohideExtension index1.html
[3]. Make a file inside C:wampwwwjayseohideExtension index2.html
[4]. Make a file inside C:wampwwwjayseohideExtension .htaccess
and copy paste below code in appropriate file name
Now run in url
[A].http://localhost/jay/seo/hideExtension/index2
Enjoy………..

index1.html

 

Hi Actually This page name = index1.html
<div><a href=”index2.html”>index2.html</a></div>

 

index2.html

 

Hi Actually This page name = index2.html
<div><a href=”index1.html”>index1.html</a></div>

 

.htaccess

 

rewriteEngine on
rewriteCond %{REQUEST_URI} !(.[^./]+)$
rewriteCond %{REQUEST_fileNAME} !-d
rewriteCond %{REQUEST_fileNAME} !-f
rewriteRule (.*) http://localhost/jay/seo/hideExtension/$1.html [L]
#rewriteRule (.*) http://localhost/jay/seo/hideExtension/$1.php [L]
rewriteCond %{the_REQUEST} ^[A-Z]{3,9} /([^.]+.)+html HTTP
rewriteRule ^(.+).html$ http://localhost/jay/seo/hideExtension/$1 [R=301,L]

 

   Share on Facebook

Page views:1325