apache - How can I redirect https://www. to https://? -
i need configure .htaccess.
actual config (just pay attention first 6 rows):
# begin wpsupercache <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewritecond %{http_host} !^mywebsite.com$ rewriterule ^(.*)$ https://mywebsite.com/$1 [r=301] #if serve pages behind proxy may want change 'rewritecond %{https} on' more sensible adddefaultcharset utf-8 rewritecond %{request_uri} !^.*[^/]$ rewritecond %{request_uri} !^.*//.*$ rewritecond %{request_method} !post rewritecond %{query_string} !.*=.* rewritecond %{http:cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$ rewritecond %{http:x-wap-profile} !^[a-z0-9\"]+ [nc] rewritecond %{http:profile} !^[a-z0-9\"]+ [nc] rewritecond %{http_user_agent} !^.*(2.0\ mmp|240x320|400x240|avantgo|blackberry|blazer|cellphone|danger|docomo|elaine/3.0|eudoraweb|googlebot-mobile|hiptop|iemobile|kyocera/wx310k|lg/u990|midp-2.|mmef20|mot-v|netfront|newt|nintendo\ wii|nitro|nokia|opera\ mini|palm|playstation\ portable|portalmmm|proxinet|proxinet|sharp-tq-gx10|shg-i900|small|sonyericsson|symbian\ os|symbianos|ts21i-10|up.browser|up.link|webos|windows\ ce|winwap|yahooseeker/m1a1-r2d2|iphone|ipod|android|blackberry9530|lg-tu915\ obigo|lge\ vx|webos|nokia5800).* [nc] rewritecond %{http_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [nc] rewritecond %{http:accept-encoding} gzip rewritecond %{https} on rewritecond %{document_root}/wp-content/cache/supercache/%{server_name}/$1/index-https.html.gz -f rewriterule ^(.*) "/wp-content/cache/supercache/%{server_name}/$1/index-https.html.gz" [l] rewritecond %{request_uri} !^.*[^/]$ rewritecond %{request_uri} !^.*//.*$ rewritecond %{request_method} !post rewritecond %{query_string} !.*=.* rewritecond %{http:cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$ rewritecond %{http:x-wap-profile} !^[a-z0-9\"]+ [nc] rewritecond %{http:profile} !^[a-z0-9\"]+ [nc] rewritecond %{http_user_agent} !^.*(2.0\ mmp|240x320|400x240|avantgo|blackberry|blazer|cellphone|danger|docomo|elaine/3.0|eudoraweb|googlebot-mobile|hiptop|iemobile|kyocera/wx310k|lg/u990|midp-2.|mmef20|mot-v|netfront|newt|nintendo\ wii|nitro|nokia|opera\ mini|palm|playstation\ portable|portalmmm|proxinet|proxinet|sharp-tq-gx10|shg-i900|small|sonyericsson|symbian\ os|symbianos|ts21i-10|up.browser|up.link|webos|windows\ ce|winwap|yahooseeker/m1a1-r2d2|iphone|ipod|android|blackberry9530|lg-tu915\ obigo|lge\ vx|webos|nokia5800).* [nc] rewritecond %{http_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [nc] rewritecond %{http:accept-encoding} gzip rewritecond %{https} !on rewritecond %{document_root}/wp-content/cache/supercache/%{server_name}/$1/index.html.gz -f rewriterule ^(.*) "/wp-content/cache/supercache/%{server_name}/$1/index.html.gz" [l] rewritecond %{request_uri} !^.*[^/]$ rewritecond %{request_uri} !^.*//.*$ rewritecond %{request_method} !post rewritecond %{query_string} !.*=.* rewritecond %{http:cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$ rewritecond %{http:x-wap-profile} !^[a-z0-9\"]+ [nc] rewritecond %{http:profile} !^[a-z0-9\"]+ [nc] rewritecond %{http_user_agent} !^.*(2.0\ mmp|240x320|400x240|avantgo|blackberry|blazer|cellphone|danger|docomo|elaine/3.0|eudoraweb|googlebot-mobile|hiptop|iemobile|kyocera/wx310k|lg/u990|midp-2.|mmef20|mot-v|netfront|newt|nintendo\ wii|nitro|nokia|opera\ mini|palm|playstation\ portable|portalmmm|proxinet|proxinet|sharp-tq-gx10|shg-i900|small|sonyericsson|symbian\ os|symbianos|ts21i-10|up.browser|up.link|webos|windows\ ce|winwap|yahooseeker/m1a1-r2d2|iphone|ipod|android|blackberry9530|lg-tu915\ obigo|lge\ vx|webos|nokia5800).* [nc] rewritecond %{http_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [nc] rewritecond %{https} on rewritecond %{document_root}/wp-content/cache/supercache/%{server_name}/$1/index-https.html -f rewriterule ^(.*) "/wp-content/cache/supercache/%{server_name}/$1/index-https.html" [l] rewritecond %{request_uri} !^.*[^/]$ rewritecond %{request_uri} !^.*//.*$ rewritecond %{request_method} !post rewritecond %{query_string} !.*=.* rewritecond %{http:cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$ rewritecond %{http:x-wap-profile} !^[a-z0-9\"]+ [nc] rewritecond %{http:profile} !^[a-z0-9\"]+ [nc] rewritecond %{http_user_agent} !^.*(2.0\ mmp|240x320|400x240|avantgo|blackberry|blazer|cellphone|danger|docomo|elaine/3.0|eudoraweb|googlebot-mobile|hiptop|iemobile|kyocera/wx310k|lg/u990|midp-2.|mmef20|mot-v|netfront|newt|nintendo\ wii|nitro|nokia|opera\ mini|palm|playstation\ portable|portalmmm|proxinet|proxinet|sharp-tq-gx10|shg-i900|small|sonyericsson|symbian\ os|symbianos|ts21i-10|up.browser|up.link|webos|windows\ ce|winwap|yahooseeker/m1a1-r2d2|iphone|ipod|android|blackberry9530|lg-tu915\ obigo|lge\ vx|webos|nokia5800).* [nc] rewritecond %{http_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [nc] rewritecond %{https} !on rewritecond %{document_root}/wp-content/cache/supercache/%{server_name}/$1/index.html -f rewriterule ^(.*) "/wp-content/cache/supercache/%{server_name}/$1/index.html" [l] </ifmodule> # end wpsupercache # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress all http:// , http://www. requests redirects https://. problem https://www. requests shows "301 moved permanently" static page. how can redirects requests https://?
moved permanently document has moved here. additionally, 500 internal server error error encountered while trying use errordocument handle request.` thanks in advance everybody!
edit: ssl_error_log file:
[thu jan 28 10:54:54 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace., referer: https://www.websitehere.com [thu jan 28 10:54:54 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace. [thu jan 28 10:54:54 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace., referer: https://www.websitehere.com [thu jan 28 10:54:54 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace. [thu jan 28 10:54:54 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace., referer: https://www.websitehere.com [thu jan 28 10:54:54 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace. [thu jan 28 10:54:54 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace., referer: https://www.websitehere.com [thu jan 28 10:54:54 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace. [thu jan 28 10:54:54 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace., referer: https://www.websitehere.com [thu jan 28 10:54:54 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace. [thu jan 28 10:54:55 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace., referer: https://www.websitehere.com [thu jan 28 10:54:55 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace. [thu jan 28 10:54:55 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace., referer: https://www.websitehere.com [thu jan 28 10:54:55 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace. [thu jan 28 10:54:55 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace., referer: https://www.websitehere.com [thu jan 28 10:54:55 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace. [thu jan 28 10:54:55 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace., referer: https://www.websitehere.com [thu jan 28 10:54:55 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace. [thu jan 28 10:54:55 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace., referer: https://www.websitehere.com [thu jan 28 10:54:55 2016] [error] [client iphere] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace.
change this
# make sure connection not https rewritecond %{https} !=on rewriterule ^/?(.*) https://%{server_name}/$1 [r=301]
Comments
Post a Comment