[英]How to redirect all users who type a particular URL of my website regardless of the cAsE they type?
Consider this example: 考虑以下示例:
I have a website called www.mycoolwebsite.com, and I have got a special directory named specialdirectory under the root, and I would like to redirect all the visitors who type: 我有一个网站www.mycoolwebsite.com,在根目录下有一个名为specialdirectory的特殊目录,我想重定向所有键入以下内容的访问者:
www.mycoolwebsite.com/specialdirectory www.mycoolwebsite.com/specialdirectory
www.mycoolwebsite.com/SpecialDirectory www.mycoolwebsite.com/SpecialDirectory
www.mycoolwebsite.com/SPEciALdIRectOry www.mycoolwebsite.com/SPECIALdIRectOry
www.mycoolwebsite.com/speCIalDIrecToRy www.mycoolwebsite.com/speCIalDIrecToRy
I mean, irrespective of what 'cAsE' they use, I would like to redirect all the traffic to the same location: www.mycoolwebsite.com/specialdirectory 我的意思是,不管他们使用什么“ cASE”,我都希望将所有流量重定向到同一位置:www.mycoolwebsite.com/specialdirectory
Any help would be greatly appreciated. 任何帮助将不胜感激。
Cheers. 干杯。 :)
:)
You need use .htaccess file in your root site witn [NC] flag. 您需要在根站点witn [NC]标志中使用.htaccess文件。 Try some like this:
试试这样:
RewriteEngine On
RewriteCond %{REQUEST_URI} [NC]
RewriteRule .* http://www.mycoolwebsite.com/specialdirectory [R=301,L,NC]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.