Htaccess 重定向/RedirectMatch 子文件夹不起作用
我对修改 .htaccess
还很陌生,并且在将某些子文件夹正确重定向到主页时遇到一些问题。
如果它只是一个域名,我不会介意,但我最近购买了一些安装了 WordPress 的旧域名。
基本上我有这个网址:http://hockeyplock.se/c/LTableCalculate.aspx?LId=162
我想将其重定向到: http://www.hockeyplock.se
到目前为止,这就是我在 .htaccess
中所拥有的内容,但它并不能解决问题。
RewriteEngine On
RedirectMatch 301 /c/(.*) /
然后我也尝试了这个:
RewriteRule ^c/(.+)$ http://hockeyplock.se/$1 [R=301,L]
但没有成功。
我知道这两种方法是不同的。我只是想尽快找到解决方案。
I'm quite new about modifying .htaccess
and I'm having some problems getting some subfolders to be redirected to the homepage properly.
I wouldn't mind if it was just one domain but I recently bought some aged domains with installed wordpress.
Basically I have this URL: http://hockeyplock.se/c/LTableCalculate.aspx?LId=162
And I want to redirect it to: http://www.hockeyplock.se
So far this is what I have in the .htaccess
but it does not do the trick.
RewriteEngine On
RedirectMatch 301 /c/(.*) /
Then I also tried this:
RewriteRule ^c/(.+)$ http://hockeyplock.se/$1 [R=301,L]
But with no success.
I know the two methods are different things. I’m just trying to find out a solution to this asap.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你就快到了:
You were almost there:
尝试将以下内容放入 hockeyplock 域根目录下的 .htaccess 文件中
Try putting the followig in your .htaccess file in the root of your hockeyplock domain