-1

我正在尝试设置以下重定向:

From: http://www.contractorshire.co.uk/plant/attachments.asp
To: http://www.contractorshire.co.uk/catalog/plant/attachments/

.htaccess 中的以下条目不起作用:

Redirect 301 /plant/attachments.asp /catalog/plant/attachments/ 

任何想法为什么?

LG

完整的.htaccess:

# Friendly URLs Part
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} .
# Force all pages to go to www.domain.com for SEO
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]
# Friendly URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
# ASP Redirects
RewriteRule ^plant/attachments\.asp$ catalog/plant/attachments/[R=302,L]
# Additional Settings Follow
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/png A2592000
BrowserMatch "MSIE" brokenvary=1
BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
BrowserMatch "Opera" !brokenvary
SetEnvIf brokenvary 1 force-no-vary
4

1 回答 1

1

我看到很多人对这种方法有问题。大多数使用mod_rewrite

RewriteEngine On
RewriteBase /
RewriteRule ^plant/attachments\.asp$ catalog/plant/attachements/ [R=301,L]

或者,我认为这Redirect需要一个绝对目标路径:

Redirect 301 /plant/attachments.asp http://contractorshire.co.uk/catalog/plant/attachments/ 
于 2013-04-20T15:43:16.130 回答