以下のコードはHTTP URLがhttpsにリダイレクトされていない以外は正常に動作します。完全なhttps URLに正しくリダイレクトされています。httpがhttpsにリダイレクトされていますが、動作していません100%
ここで、httpリダイレクトが機能しない方法を参照してください。 http://www.jamavarrestaurants.com/s/6/mayfair-private-dining-with-private-room
ここで働いていますが、私たちはURLにsection.phpを入れません。 http://www.jamavarrestaurants.com/section.php/6/mayfair-private-dining-with-private-room
注:問題を混乱させるだけで、SEFチェックとURL構造を含むsection.phpファイルがコピーされ、現在使用されているか、または使用されるコピー "s.php"が作成されました。 products.php、article.php、およびdiscount.phpと同じです。
ご協力いただければ幸いです。
#Header append X-FRAME-OPTIONS "SAMEORIGIN"
RewriteEngine On
RewriteBase/
## HTTP > HTTPS (only works for this format
http://www.jamavarrestaurants.com/section.php/3/1/mayfair-restaurant)
## see: http://www.codexworld.com/redirect-non-www-to-www-http-to-https-
using-htaccess-file/
RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule^https://www.jamavarrestaurants.com%{REQUEST_URI} [NE,L]
## RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
# RewriteRule ^index\.php$ https://www.jamavarrestaurants.com/ [R=301,L]
#
## Added beciause the catch all 404 redirect was sending to /index
# RewriteRule ^index?$ https://www.jamavarrestaurants.com [L,R=301,NC]
#
### JSHOP CORE REWRITE RULES ###
################################
#<IfModule mod_rewrite.c>
Options +SymlinksIfOwnerMatch +MultiViews
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*?).php/(.*?) $1.php?$2
## special rewrite rules for shortened urls ##
RewriteRule ^section.php/(.*) /s/$1 [R=301,L]
RewriteRule ^section/(.*) /s/$1 [R=301,L]
#
### To remove section page if 1 which is default for most (unless products
span more)
RewriteRule ^s.php/(.*)/1/(.*) /s/$1/$2 [R=301,L]
#RewriteRule ^s/(.*)/1/(.*) /s/$1/$2 [R=301,L]
#
RewriteRule ^product.php/(.*) /p/$1 [R=301,L]
RewriteRule ^product/(.*) /p/$1 [R=301,L]
RewriteRule ^article.php/(.*) /a/$1 [R=301,L]
RewriteRule ^article/(.*) /a/$1 [R=301,L]
RewriteRule ^discount.php/(.*) /d/$1 [R=301,L]
RewriteRule ^discount/(.*) /d/$1 [R=301,L]
#</IfModule>
###########################
# The rest
############################
おかげで、内部サーバーエラー – Puzzel
を与えていただきありがとうございます。今は動作しますが、httpは完全なURLにリダイレクトされません。http://www.jamavarrestaurants.com/s/5/mayfair-food-and-wine-menus – Puzzel
これはすべての歴史的なインバウンドリンクが壊れることです。 – Puzzel