2017-11-29 13 views
1

これは間違いありませんか?複数のRewriteCondを持つhtaccessファイル

私はwww.alltheoptions.co.ukに移動しようとしたが、それはあなたがこれまで最初のルール変更できhttps://バージョン

# Redirect Browser to https 
RewriteEngine On 
RewriteCond %{HTTP_HOST} !^www\.alltheoptions\.co.uk$ [NC] [OR] 
RewriteCond %{HTTP_HOST} !^\alltheoptions\.co.uk$ [NC] [OR] 
RewriteCond %{HTTP_HOST} !^\http://alltheoptions\.co.uk$ [NC] 

RewriteRule ^(.*)$ https://www.alltheoptions\.co.uk/$1 [R=301,L] 


# Block Unwanted User Agents - Spiders/Bots 
<IfModule mod_rewrite.c> 
SetEnvIfNoCase ^User-Agent$ .*(bot1|bot2|bot3|bot4|bot5|bot6|) HTTP_SAFE_BADBOT 
SetEnvIfNoCase ^User-Agent$ .*(bot1|bot2|bot3|bot4|bot5|bot6|) HTTP_SAFE_BADBOT 
Deny from env=HTTP_SAFE_BADBOT 
</ifModule> 

# Security - name to access htaccess file 
AccessFileName ht.access 

答えて

1

にリダイレクトされませんでした:私が参照するときに覚えておくべき主なものがあると思い

RewriteEngine On 

RewriteCond %{HTTP_HOST} !^www\.alltheoptions\.co\.uk$ [NC,OR] 
RewriteCond %{HTTPS} !on 
RewriteRule^https://www.alltheoptions\.co.uk%{REQUEST_URI} [R=301,L,NE] 
+1

を'.co.uk' URLでは' \(バックスラッシュ) 'がすべての'の前に存在する必要があります。 (ドット) ' – Adam

関連する問題