我正在使用Mediatemple Hosting,我的网站运行正常。但是,只有一些文件在工作时返回404找不到的标题。这是我的.htaccess文件供参考。
AddType application/x-httpd-php .php .htm .html .phtml
# Redirect www urls to non-www
RewriteEngine on
DirectoryIndex home.php
RewriteCond %{HTTP_HOST} ^www\.sitename\.com [NC]
RewriteRule (.*) http://sitename.com/$1 [R=301,L]
#To redirect www-subdomains to subdomains
#RewriteCond %{HTTP_HOST} ^www\.(.+)\.sitename\.com [NC]
#RewriteRule (.*) http://sitename.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^(anup|democollege|sghps|sacademy|dds)\.sitename\.com$ [NC]
#RewriteRule ^(.*)$ http://sitename.com/$1 [P]
RewriteRule ^(.*)$ /p/$1 [P]
RewriteCond %{HTTP_HOST} !^(www\.)?sitename\.com$ [NC]
RewriteRule ^(.*)$ /nen/$1 [L]
RewriteRule ^announcement blog/announcement/ [L]
RewriteRule ^announcement/(.*)$ blog/announcement/$1 [L]
RewriteRule ^news blog/news/ [L]
RewriteRule ^news/(.*)$ blog/news/$1 [L]
RewriteRule ^forum blog/forum/ [L]
RewriteRule ^forum/(.*)$ blog/forum/$1 [L]
RewriteRule ^offers /blog/offers/ [L]
RewriteRule ^offers/(.*)$ /blog/offers/$1 [L]
RewriteRule ^(clat|jee_main|medical_pg_entrance|dental_pg_entrance|ctet|mht_cet|mbbs_entrance|banking|ntse|cmat|crt|gate)$ /index.php?course=$1 [L]
RewriteCond %{REQUEST_URI} !(class|classes|offers|forum|announcement|news)
RewriteRule ^(clat|jee_main|medical_pg_entrance|dental_pg_entrance|ctet|mht_cet|mbbs_entrance|banking|ntse|cmat|crt|gate)/(.*)$ /$2?course=$1 [L,QSA]
#RewriteRule ^(.*)$ dispatcher.php [L]
RewriteRule ^(.*)/classes/(.*)$ /classes.php?course=$1¶ms=$2 [L]
RewriteRule ^classes/(.*)$ /classes.php?params=$1 [L]
RewriteRule ^class/(.*)$ /class_profile.php?params=$1 [L]
RewriteRule ^(.*)/class/(.*)$ /class_profile.php?params=$2 [L]
#compress assets
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
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
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>
#ends comress assets
php文件正在运行,但响应代码为404。