Jump to content

Hide PHP and HTML extension in URL


Recommended Posts

Can someone help me with the following :

 

I would like to hide the php and html extensions on my website. I came across a lot of stuff with the HTacces. But i'm not really good at it. 

 

My websites are http://www.slaapzakken-discounter.nl and http://www.rugzakken-discounter.nl 

 

Please give me some advise how i can hide the extensions.

 

Thanks in advance

 

 

Link to comment
Share on other sites

When you are on the product page, the website is www.blabla.nl/test.product.html That is what is would like to hide. This is a technical improvement for my website. I'm using an SEO program that gives me the advise to hide the php and html code. 

Link to comment
Share on other sites

in this case it will be necessary to modify "pattern" under preferences > seo & urls tab in your back office.

you can specify there address format to certain page types in your store.

 

you will need also modify dispatcher.php class (classes/Dispatcher.php)

 

there is code:
 

			'rule' =>		'{category:/}{id}-{rewrite}{-:ean13}.html',

remove .html

 

 

after this it's necessary to regenerate .htaccess file.

Link to comment
Share on other sites

  • 1 month later...

Just a comment to this topic, I just removed the ".html" part in the field "Route to products"   under Preferences--->SEO and URLs

--->Schema of URLs.   With friendly url's enabled the ".html" part went away. I dont know if it breaks anything though, but, hell, trying and failing is life in a nutshell.

Link to comment
Share on other sites

Just a comment to this topic, I just removed the ".html" part in the field "Route to products"   under Preferences--->SEO and URLs

--->Schema of URLs.   With friendly url's enabled the ".html" part went away. I dont know if it breaks anything though, but, hell, trying and failing is life in a nutshell.

 

it will not break anything :)

this is the proper way to achieve it

we can also modify dispatcher controller, but i think this way is for developers only :P

thanks for information!

Link to comment
Share on other sites

  • 1 month later...

in simple words - that's right :) but in fact, it's a bit more complicated (in prestashop)

 

Taking away ".html" from the Schema of URLs means rewriting of .htaccess and redirect the old .html pages to the new without .html ending? 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...