Problem detecting empty REQUEST_URI with Apache mod_rewrite

后端 未结 8 1890
南方客
南方客 2021-01-03 00:57

I am running Apache witha redirect rule like this:

RewriteCond %{HTTP_HOST} ^1st-domain\\.com
RewriteRule ^(.*)$ http://2nd-domain.com$1 [R=permanent,L]
         


        
8条回答
  •  没有蜡笔的小新
    2021-01-03 01:11

    I am using the following to catch empty REQUEST_URL:

    RewriteEngine on

    RewriteCond %{REQUEST_URI} "^/$"

    RewriteRule ^(.*) http://%{HTTP_HOST}/my/another/url

提交回复
热议问题