0

在我的网址中,我已将“国家”一词替换为“landelijke-deals”

例如,来自: http://allthedeals.nl/deals/national/reizen-vakantie

至: http://allthedeals.nl/deals/landelijke-deals/reizen-vakantie

我正在使用这个:

RewriteRule ^national/(.*) /landelijke-deals/$1 [R=301,L]

重定向,但由于某种原因它无法正常工作,我没有看到什么?

更新:这是我当前的 htacces 文件

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.allthedeals\.nl$ [NC]
RewriteRule ^(.*)$ http://allthedeals.nl/$1 [R=301,L]
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^deals([-a-zA-Z\/]+)?$ deals.php?vars=$1 [L,QSA]
#
RewriteRule ^deal/([-_a-zA-Z0-9]+)/([0-9]+)$ CustomDealDetail.php?dealId=$2&seo=$1 [L,QSA]
RewriteRule ^deal/([0-9]+)/([-_a-zA-Z0-9]+)$ old_id_redirect.php?old_id=$1&seo=$2 [L,QSA]
RewriteRule ^aggdeal/([0-9]+)/(.*)$ dealdetails.php?dealId=$1 [L,QSA]
RewriteRule ^deal-aanbieders$ deal-aanbieders.php [L,QSA]
RewriteRule ^deals/national/(.*) /deals/landelijke-deals/$1 [R,L]
#RewriteRule ^index\.htm$ index.php [NC,R]
4

2 回答 2

0

你的 RewriteRule 是错误的。请改用以下重写规则:

RewriteRule ^/deals/national/(.*)$ /deals/landelijke-deals/$1 [R=301,L]
于 2012-06-07T12:08:28.750 回答
0

这是您需要的规则:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteRule ^(deals)/national/(.+)$ $1/landelijke-deals/$2 [R=301,L.NC]
于 2012-06-07T12:18:52.603 回答