Ask the great god htaccess file rules

Source: Internet
Author: User
There are two requirements.
1.http Auto Jump HTTPS
2.index.php Shield off, thinkphp frame.

Thanks

Reply content:

There are two requirements.
1.http Auto Jump HTTPS
2.index.php Shield off, thinkphp frame.

Thanks

It is recommended to view related documents. Http://www.htaccesseditor.com/sc.shtml provides a web that can be generated online.

Add: HTTP://HI.BAIDU.COM/HONFEI/ITEM/0893A6E12984903A4DDCAFBC

One, HTTP jumps directly to HTTPS

RewriteEngine onRewriteCond %{SERVER_PORT} !^443$RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [L,R]

Second, TP shielding index.php
If it is Apache, you will need to add the. htaccess file to the sibling of the portal file with the following content:


  
   
    
   RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
  
   

Nginx Environment
In Nginx low version, PathInfo is not supported, but can be implemented by configuring a forwarding rule in nginx.conf:

 location / { // …..省略部分代码   if (!-e $request_filename) {   rewrite  ^(.*)$  /index.php?s=$1  last;   break;    } }

thinkphp manual will be described, suggest a closer look:)

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.