-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 に答える