1

私はこのhtaccess条件を持っています...

# changed... subdomains to subdirectories...
RewriteCond %{HTTP_HOST} ^acoruna.domain\.es [nc]
RewriteRule (.*) http://domain.es/acoruna/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^alava.domain\.es [nc]
RewriteRule (.*) http://domain.es/alava/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^albacete.domain\.es [nc]
RewriteRule (.*) http://domain.es/albacete/$1 [R=301,L]
# changed... subdomains to subdirectories...

私の質問は、RewriteCond と Rewrite ルールをすべて 1 つだけにマージできますか? みんなやることは同じだから。

ありがとう、スペインからよろしく。

4

1 に答える 1

1

試す:

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^([^.]+)\.domain\.es$ [NC]
RewriteRule ^(.*)$ http://domain.es/%1/$1 [R=301,L]
于 2013-04-03T14:01:52.580 に答える