htaccess从网址中删除字符并重定向 [英] htaccess delete characters from url and redirect
本文介绍了htaccess从网址中删除字符并重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从网址中删除_/
.
示例:mysite.com/_/something
想要重定向到mysite.com/something
推荐答案
通过httpd.conf
启用mod_rewrite和.htaccess,然后将此代码放在DOCUMENT_ROOT
目录中的.htaccess
中:
Enable mod_rewrite and .htaccess through httpd.conf
and then put this code in your .htaccess
under DOCUMENT_ROOT
directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^_/(.*)$ /$1 [L,R=301]
这篇关于htaccess从网址中删除字符并重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文