例如,如果我有example.com/experiments.html并且用户键入example.com/experiment.html(no“s”),是否可以使用example.com/experiments.html将用户重定向到example.com/experiments.html的.htaccess?使用.htaccess修复输入错误?
编辑:“experiments.html”只是一个例子,我有很多页面,用户可能输入不正确。有没有通用的解决方案?
例如,如果我有example.com/experiments.html并且用户键入example.com/experiment.html(no“s”),是否可以使用example.com/experiments.html将用户重定向到example.com/experiments.html的.htaccess?使用.htaccess修复输入错误?
编辑:“experiments.html”只是一个例子,我有很多页面,用户可能输入不正确。有没有通用的解决方案?
一个简单的方法是使用redirect
Redirect 301 /experiment.html /experiments.html
你可以使用一个RewriteRule
这样的:
RewriteRule experiment.html experiments.html [L,R=301]
这将做301永久重定向