mod_rewrite只有一些规则可行

时间:2015-12-02 16:03:19

标签: php apache .htaccess mod-rewrite

我有一个.htaccess文件,除了一件事,一切都有效。 example.com/home重定向到home.php,对headsup_bet等文件也是如此。如果我清除整个.htaccess /home仍然会重定向到home.php

我最近改变了网络主机,而旧网站的主机已经改变了。但现在不行了。

Options -Indexes
Options +FollowSymLinks
RewriteEngine on

# Remove www
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]

# Make sure site is using SSL
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Rewrite urls
RewriteRule ^home$              index.php?page=home [L]
RewriteRule ^jackpot$           index.php?page=jackpot [L]
RewriteRule ^roulette$          index.php?page=roulette [L]
RewriteRule ^headsup$           index.php?page=headsup [L]
RewriteRule ^blender$           index.php?page=blender [L]
RewriteRule ^taxi$              index.php?page=taxi [L]
RewriteRule ^user$              index.php?page=user [L]
RewriteRule ^jackpots$          index.php?page=jackpots [L]
RewriteRule ^players$           index.php?page=players [L]
RewriteRule ^recruits$          index.php?page=recruits [L]
RewriteRule ^deposit$           index.php?page=deposit [L]
RewriteRule ^withdraw$          index.php?page=withdraw [L]
RewriteRule ^information$       index.php?page=information [L]
RewriteRule ^provably-fair$     index.php?page=provably-fair [L]
RewriteRule ^terms$             index.php?page=terms [L]
RewriteRule ^support$           index.php?page=support [L]
RewriteRule ^contact$           index.php?page=contact [L]
RewriteRule ^settings$          index.php?page=settings [L]
RewriteRule ^admin$             index.php?page=admin [L]
RewriteRule ^steamDown$         index.php?page=steamDown [L]
RewriteRule ^403$               index.php?page=403 [L]
RewriteRule ^404$               index.php?page=404 [L]

# Cache files 1 WEEK 
ExpiresActive On
ExpiresDefault A0

<FilesMatch "\.(jpg|jpeg|png|gif|swf|css|js)$">
ExpiresDefault A604800
</FilesMatch>

# Compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

order allow,deny
allow from all

ErrorDocument 404 /404
ErrorDocument 403 /403

php_flag display_errors 1

1 个答案:

答案 0 :(得分:1)

这整个问题非常奇怪,但是通过添加Options -MultiViews解决了这个问题。

如果有人知道为什么,我会非常乐意学习。

相关问题