Problem detecting empty REQUEST_URI with Apache mod_rewrite

后端 未结 8 1831
南方客
南方客 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:02

    I tried the options stated on this page, all I wanted was to check if the REQUEST_URI is empty (or in this particular case, a /):

    # Check of the request uri is just 1 char long (checking for a slash was harder):
    RewriteCond %{REQUEST_URI} ^.$
    

提交回复
热议问题