.htaccess加载.php扩展名的文件

时间:2016-08-28 13:39:57

标签: php .htaccess

这是我的.Htaccess

DirectoryIndex index.php
<IfModule mod_gzip.c>
    mod_gzip_on       Yes
    mod_gzip_dechunk  Yes
    mod_gzip_item_include file      \.(html?|txt|css|js|php|pl|jpg|png|gif)$
    mod_gzip_item_include handler   ^cgi-script$
    mod_gzip_item_include mime      ^text/.*
    mod_gzip_item_include mime      ^application/x-javascript.*
    mod_gzip_item_exclude mime      ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
Options -Indexes

RewriteEngine On
RewriteBase /news/freshadmin/
RewriteRule ^styles/(.+)?$ templates/styles/$1 [L]
RewriteRule ^scripts/(.+)?$ templates/scripts/$1 [L]
RewriteRule ^icons/(.+)?$ templates/icons/$1 [L]
RewriteRule ^images/(.+)?$ templates/images/$1 [L]

# Removed Redirect Loop #1518
#RewriteRule ^ajax/(.+)?$ ajax/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?q=$1 [QSA,L]

我想加载带有php扩展名的页面。我删除了最后一行

 RewriteRule ^(.+)$ index.php?q=$1 [QSA,L]

并使用.php加载页面,但它显示404 Not Found 我这样进入我的页面。 www.mysite.com/admin/index.php 但是发生了404错误。

0 个答案:

没有答案