cancel
Showing results for 
Search instead for 
Did you mean: 

404 error page changing store views in home page after removing .html suffix

404 error page changing store views in home page after removing .html suffix

While removing .html suffix for categories and products page through admin (configuration->catalog->catalog->seo), the home page loads 404 page when changing languages.

 

For products and categories, .html suffix has been removed without any issue even when switching languages.

 

But experiencing when switching languages in home page, it loads 404 pages.

I have already cleared cache and reindex the site, still same issue.

I have also static pages and this works properly.

 

Any help and clarification would be most welcome.

 

Thanks

 

 

5 REPLIES 5

Re: 404 error page changing store views in home page after removing .html suffix

As I can see you are using correct method. I had same issue.

Here are some steps:

1) Remove var/generation directory
2) Then run blow commands:

sudo rm -Rf var/generation/* var/di/* var/cache/*
sudo rm -Rf pub/static/frontend/* var/pre_processed/* pub/static/_requirejs/*
sudo php bin/magento setup:di:compile
sudo php bin/magento setup:static-content:deploy -f
sudo php bin/magento cache:clean
sudo php bin/magento cache:flush
sudo chmod -R 777 var/ pub/ generated/
sudo php bin/magento indexer:reindex


I hope it will work for you.

 

--
If my answer is useful, please Accept as Solution & give Kudos

Re: 404 error page changing store views in home page after removing .html suffix

Hello @magento_magentodev ,

 

Please run below command in magento root directory

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
rm -rf pub/static/frontend/* pub/static/adminhtml/* var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ var/composer_home generated/*
php -dmemory_limit=6G bin/magento setup:static-content:deploy -f
chmod -Rf 777 pub/ var/ generated/
php bin/magento indexer:reindex

--
If my answer is useful, please Accept as Solution & give Kudos

Re: 404 error page changing store views in home page after removing .html suffix

I have tried these steps but still it does not resolves the issues.

 

I have cleanup all the mentioned directories and regenerate the files but still issue is still present.

 

The moment it changes store view, it performs a redirect

stores/store/switch/?___from_store=it&___store=en

to 

Home Page

Then 404 error page.

 

Thanks

Re: 404 error page changing store views in home page after removing .html suffix

Hello @magento_magentodev ,

 

Please provide website URL.

 


--
If my answer is useful, please Accept as Solution & give Kudos

 

 

 

Re: 404 error page changing store views in home page after removing .html suffix

Hi,

Thanks for the reply.

Here is the staging environment domain and i have remove .html suffix through admin:

http://metrica-staging.northeurope.cloudapp.azure.com/

By default, it loads the Italian language version, and if you change language, you will encountered the 404 error page.

 

But when you are in other pages such as categories or product page and you can languages, it loads properly.

 

Please advise if you observe something weird.

 

Thanks.