[英]Remove folder form URL using htaccess
I had moved my website to one step back. 我将网站移回了一步。 So before that the link was
www.example.com/abc/test.php
, but now the link is www.example.com/test.php
. 因此,在此之前,该链接为
www.example.com/abc/test.php
,但现在该链接为www.example.com/test.php
。
I want to remove the abc
folder name from the links, if any user visit the links containing the abc
folder I want to remove abc
folder from it. 我想从链接中删除
abc
文件夹名称,如果有任何用户访问包含abc
文件夹的链接,我想从其中删除abc
文件夹。
I have tried 我努力了
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^abc/(.*)$ /$1 [L,R=301]
This works for me: 这对我有用:
RewriteEngine On
RewriteRule ^abc/(.*)$ /$1 [L,NC,R]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.