我的网站一直在使用以下代码从网址
的末尾删除.PHPRewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
我现在已经在/ clients /上安装了WordPress文件夹,但它不能正常工作,因为它重写了WordPress,我不想让它做,但我不知道如何修复上面的代码来阻止它发生在sup文件夹中。
由于
完整.htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
压缩文本,html,javascript,css,xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
或者,按扩展名压缩某些文件类型:
SetOutputFilter DEFLATE
答案 0 :(得分:0)
在/ clients /文件夹中添加.htaccess文件,其中包含以下内容: -
RewriteEngine off
在里面。这会关闭该文件夹的mod_rewrite,它是子文件。
瞧