Home  >  Q&A  >  body text

apache - How to write a .htaccess rule

Used typecho Currently it is pseudo-static

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/ [L]

Recently, HTTPS CDN has been added. How can we automatically jump from http 301 to https (of course, we must also keep pseudo-static)?
What I found on Google are basically wordpress rules. I modified them and used them. , chrome access will prompt multiple redirection
I am familiar with nginx, but there is no way to change the web server. I hope friends who know more can give me some advice. Thank you.

PHP中文网PHP中文网2713 days ago492

reply all(1)I'll reply

  • 滿天的星座

    滿天的星座2017-05-16 17:03:07

    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://domain name/$1 [R,L]
    or
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^(.*)$ https://domain name/$1 [L,R=301]

    reply
    0
  • Cancelreply