Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Product URL Suffix not working
 
Hobbitje78
Jr. Member
 
Total Posts:  7
Joined:  2010-11-17
 

Hi there,

I’m trying to get rid of the .html-extension in my url’s. I want to end with a trailing slash.

My url now looks like:
http://www.shop.com/category/product.html

It should be:
http://www.shop.com/category/product/

So in the back-end i go to System > Configuration > Catalog > Search Engine Optimization

Next I deleted the .html at Product URL Suffix and Category URL Suffix and used the trailing slash / instead.

Refeshed my caches and reindexed my urls.

Still nothing changed.

Who can help me out with this? Thanks in advanced.

 
Magento Community Magento Community
Magento Community
Magento Community
 
VnEcoms
Sr. Member
 
Avatar
Total Posts:  121
Joined:  2012-09-13
Vietnam
 

edit file .htaccess
find this code:

<IfModule mod_rewrite.c>

############################################
## enable rewrites

    
Options +FollowSymLinks
    RewriteEngine on
Add this code after

RewriteCond %{REQUEST_URI} !(.*)/$
 
RewriteCond %{REQUEST_URI} !(.*)\.html$
 
RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond 
%{REQUEST_FILENAME} !-d
 RewriteCond 
%{REQUEST_FILENAME} !-l
 RewriteRule 
^(.*)$ http://%{HTTP_HOST}/$1/ [L,R=301]
 
Magento Community Magento Community
Magento Community
Magento Community
 
Hobbitje78
Jr. Member
 
Total Posts:  7
Joined:  2010-11-17
 

Thanks for your help!

I have inserted your code into the .htaccess file. Refeshed my Caches again and reindexed my urls. But still the .html appears in my urls.
My code now is:

<IfModule mod_rewrite.c>

############################################
## enable rewrites

    
Options +FollowSymLinks
    RewriteEngine on
    
     RewriteCond 
%{REQUEST_URI} !(.*)/$
     
RewriteCond %{REQUEST_URI} !(.*)\.html$
     
RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond 
%{REQUEST_FILENAME} !-d
     RewriteCond 
%{REQUEST_FILENAME} !-l
     RewriteRule 
^(.*)$ http://%{HTTP_HOST}/$1/ [L,R=301]

I have checked the php configuration with a php info file. Shouldn’t there appear the “Mod_rewrite\” module?
I can’t find this one.

Or should I check some other things?

Thanks in advanced.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hobbitje78
Jr. Member
 
Total Posts:  7
Joined:  2010-11-17
 

I found out that your solution with .htaccess did help.

But it keeps the .html in the url.
When I go to the back-end of Magento and I change the URL-key from a product or category and i save this. It wil create the new URL without the .html. That’s good!!

But.....when i reindex my urls ( I do this by shell access) the .html is back again.
So, something goes wrong when i reindex my catalog_url.

What can go wrong?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hobbitje78
Jr. Member
 
Total Posts:  7
Joined:  2010-11-17
 

Is someone familiar with this? Or having some thoughts about it?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mirasvit
Guru
 
Avatar
Total Posts:  639
Joined:  2009-08-22
 

I think, it is more easy to solve using the extension for work with SEO. Try this Advanced SEO Suite http://mirasvit.com/magento-extensions/advanced-seo-suite.html

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top