301重定向不工作,是我想要的可能吗? [英] 301 redirect not working , is what I want possible?

查看:719
本文介绍了301重定向不工作,是我想要的可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我的.htaccess文件

Here is my .htaccess file

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L]
</IfModule>
# END WordPress 

Redirect 301 http://whattodoindublin.com/ http://www.whattododirectory.com/category/dublin/

http://whattodoindublin.com/ 是指向同一个文件夹中的 http://www.whattododirectory.com/ 所以它加载同样的内容,但我想要的 http://whattodoindublin.com/ 加载子目录上面,这可能吗?

http://whattodoindublin.com/ is pointing to the same folder as http://www.whattododirectory.com/ so it loads of the same content but I want http://whattodoindublin.com/ to load the subdirectory as above , is this possible?

推荐答案

从的重定向指令

语法:重定向[状态] URL路径URL
  ...
  旧的URL路径是区分大小写的(%-de codeD)路径的用斜线开始。相对路径是不允许的。

Syntax: Redirect [status] URL-path URL
...
The old URL-path is a case-sensitive (%-decoded) path beginning with a slash. A relative path is not allowed.

您只能重定向的路径的一个外部URL。也许在你的虚拟主机部分还是在的.htaccess的whattodoindublin.com,你可以做

You can only redirect a path to an external URL. Maybe in your virtual host section or in the .htaccess for whattodoindublin.com, you can do

Redirect 301 / http://www.whattododirectory.com/category/dublin/

这篇关于301重定向不工作,是我想要的可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆