简体   繁体   English

redirectMatch 301不起作用(htaccess)

[英]redirectMatch 301 not working (htaccess)

this is a htaccess issue I have and I can't solve. 这是我遇到的htaccess问题,我无法解决。 I've just moved my site from /2014 to / (root directory) and I want to redirect everything from 2014 to root directory just in case. 我刚刚将网站从/ 2014移到了/(根目录),我想将所有内容从2014重定向到根目录,以防万一。 The last parameter is another thing, it's working but I include it here just in the case it may be interfering the redirectMatch 301. 最后一个参数是另一回事,它正在工作,但我将其包括在这里,以防可能干扰redirectMatch 301。

#Active RewriteEngine
RewriteEngine on

# 301 Redirect Entire Directory 2014 to root
redirectMatch 301 ^2014(.*)$ http://www.rosariodesign.com$1

#Friendly URL for /registro.php -> /registro
RewriteRule ^registro/?$ registro.php

What may be the problem? 可能是什么问题? Thanks in advance! 提前致谢!

Place this code in /2014/.htaccess : 将此代码放在/2014/.htaccess

RewriteEngine on
RewriteBase /2014/

RewriteRule ^(.*)$ http://www.rosariodesign.com/$1 [L,R=301,NE]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM