Fix typos using .htaccess?

For example, if I have example.com/experiments.html and user types in example.com/experiment.html(no "s"), can I redirect the user to example.com/experiments.html using .htaccess?

Edit: "experimental.html" was just an example, I have a lot of pages that users may not enter correctly. Is there a universal solution?

+4
source share
2 answers

A simple way is to use redirect

 Redirect 301 /experiment.html /experiments.html 
+5
source

You can use RewriteRule as follows:

 RewriteRule experiment.html experiments.html [L,R=301] 

This will make 301 permanent redirects.

+2
source

Source: https://habr.com/ru/post/1381998/


All Articles