简体   繁体   English

如何重定向所有键入我网站的特定URL的用户,而不管他们键入的cASE?

[英]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.

相关问题 登录用户输入时的主页网址重定向 - Homepage url redirect when logged in users type it in 如何获得不是Symfony中特定组成员的所有用户? - How to get all users who are not member of a particular group in Symfony? Codeigniter:清理我的URL(删除index.php)之后,我无法将访问我的网站的用户重定向到新的干净URL - Codeigniter: After cleaning my URLs(removing index.php) I couldn't redirect users who accessed my website to the new clean URL 如何关注在我的网站上使用Twitter登录的用户? - How to follow users who sign in with twitter on my website? 如何重定向到特定的URL - How to redirect to particular URL 如何将网站重定向到特定文件? - How to redirect website to particular file? 获取不在laravel 5.2中特定组中的所有用户 - Getting all the users who are not in the particular group in laravel 5.2 OnClick重定向到我在PHP中的网站的特定部分 - OnClick redirect to a particular section of my website in Php 在 PHP 的情况下,如何阻止既不是 ADMIN 也不是 STAFF 的用户访问某些页面? - How to block access to certain pages to Users who are neither ADMIN nor STAFF in my case in PHP? 如何将未登录Wordpress网站的用户重定向到特殊的登录页面? - How can I redirect users who are not logged in to my Wordpress site to a special login page?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM