Magento .htaccess Removal of index.php from Store

2019-07-30 16:27发布

问题:

I do not want my URLs on my Store to contain index.php. All my product pages can be accessed via addition of index.php and without it which is not good and I want to get rid of index.php from the urls.

For example, both of these urls display the same content, but I only want users to ever be directed to the second URL:
http://www.pudu.com.au/index.php/outback-mens-denim-cargo-shorts.html & http://www.pudu.com.au/outback-mens-denim-cargo-shorts.html

Likewise for content at the top level of the site:
http://www.pudu.com.au/index.php &
http://www.pudu.com.au/

回答1:

Magento adds the system endpoint (index.php) to the URL path based on a configuration setting. In the admin, navigate to System > Configuration. In the Web section, open the Search Engines Optimization group and set Use Web Server Rewrites to "Yes". You'll need to flush the configuration cache and redindex URL rewrites thereafter.