0
我有domain.com/forums但我需要幫助重定向論壇sub.domain.com重寫配置重定向目錄子域
下面的作品,但我最終
sub.domain/forums/topic-name-here
RewriteEngine on
RewriteRule ^(.*)$ http://sub.domain.com/$1 [R=301,L]
我有domain.com/forums但我需要幫助重定向論壇sub.domain.com重寫配置重定向目錄子域
下面的作品,但我最終
sub.domain/forums/topic-name-here
RewriteEngine on
RewriteRule ^(.*)$ http://sub.domain.com/$1 [R=301,L]
試試這個:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^\/?forum\/.*
RewriteRule ^\/?forum\/(.*)$ http://sub.domain.com/$1 [R=301,L]
PS我使用「/?」因爲我忘記了REQUEST_URI格式:(