Apache rewrite rule problem?
滿天的星座
滿天的星座 2017-05-16 17:00:57
0
1
543

1 hi, I want to implement the following rules:
All requests are directed to index.php
All resources (pictures, css, etc.) are directly accessed

How should I write my .htaccess? ? ? ?

滿天的星座
滿天的星座

reply all(1)
世界只因有你
<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.*)$ index.php [QSA,PT,L]
</IfModule>
  1. Cond is like this. If the file or folder exists, access it directly.

  2. OK, if it does not exist, rewrite the Rules and point them all to index.php

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!