How do I remove the file extensions from the url?
Currently it looks like this:
www.example.com/about.html
www.example.com/blog.html
www.example.com/contact.html
I want it to look like this:
www.example.com/about
www.example.com/blog
www.example.com/contact
I understand I have to modify my .htaccess in my base directory. My current .htaccess looks like this:
[HTML]
DirectoryIndex index.html index.php
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php?sef_rewrite=1 [L,QSA]
[/HTML]
To remove file extension on Categories only:
Administration » Addons » SEO - edit
Find: “Category SEF URL format” and select the 2nd or 3rd option.
Post about the same subject:
[url]http://forum.cs-cart.com/showthread.php?t=14404&highlight=Remove+file+extension[/url]
Does anybody know if either of these ways are more benificial than the other or is it just a “look” thing
JOhn
@johnbol1 The reason I have always done it is for SEO. Look at it this way, a search engine will craw your site indexing all the pages. They index the entire url (www.example.com/about.html). Over time you rank will improve and rank higher and higher with that page. Now lets say you completely re-haul your website because you have grown so much and now you have to use a different extension, let say “.php”. That high ranking page is not longer there, all because you changed your file extension. If you remove it to begin with you will not have to worry about this issue in the future. Then what if people are linking to a page on your site, that will be now broken. Yea, I know you can set up a 301, but it still wont help your ranking. Also, personally I think it looks better with the extension removed.
Thanks for info
[quote name=‘kennedysgarage’]@johnbol1 The reason I have always done it is for SEO. Look at it this way, a search engine will craw your site indexing all the pages. They index the entire url (www.example.com/about.html). Over time you rank will improve and rank higher and higher with that page. Now lets say you completely re-haul your website because you have grown so much and now you have to use a different extension, let say “.php”. That high ranking page is not longer there, all because you changed your file extension. If you remove it to begin with you will not have to worry about this issue in the future. Then what if people are linking to a page on your site, that will be now broken. Yea, I know you can set up a 301, but it still wont help your ranking. Also, personally I think it looks better with the extension removed.[/QUOTE]
how about use make php run the html like i do…
Hello!
I would like to remove “.html” extension to only two pages. I tried to redirect with CPanel but it did not work for me.
My requirement is like this.
From: www.domain.com/page1.html redirect to www.domain.com/page1
From www.domain.com/page2.html redirect to www.domain.com/page2
Please advice…
[quote name='Raj' timestamp='1284765268' post='89676']
Hello!
I would like to remove “.html” extension to only two pages. I tried to redirect with CPanel but it did not work for me.
My requirement is like this.
From: www.domain.com/page1.html redirect to www.domain.com/page1
From www.domain.com/page2.html redirect to www.domain.com/page2
Please advice…
[/quote]
Take a Look at this post: SEO: remove .html - General Questions - CS-Cart Community Forums
That might help you.