糟糕的htaccess? 组成运行多个功能。 下面是显示500内部错误的代码,不明白为什么?
RewriteEngine on
#RewriteCond %{REQUEST_FILENAME}.php -f [OR]
#RewriteCond %{REQUEST_FILENAME}.php -d
#RewriteRule ^([^\.]+)$ $1.php [NC,L]
#Forbids Directory access
Options -Indexes
#Root index file
DirectoryIndex login.php
#Rule for maintaining user url
RewriteRule ^users/(.*)/(.*)/(.*+)/?$ pages/$2.php?social_id=$1 [QSA]
#Initiallinzing user url
RewriteRule ^users/(.*+)/?$ pages/profile.php?social_id=$1 [QSA]
#direct access to login.php
RewriteRule ^login login.php [QSA]
#direct access to logout.php
RewriteRule ^logout logs/logout.php [QSA]
#direct access to help.php
RewriteRule ^help help.php [QSA]
# # Use Mod_deflate to compress static files
<ifmodule mod_deflate.c>
<filesmatch ".(js|css|ico|txt|htm|html|php)$">
SetOutputFilter DEFLATE
</filesmatch>
</ifmodule>
答案 0 :(得分:0)
尝试:
#Forbids Directory access
Options -Indexes
#Root index file
DirectoryIndex login.php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.+)$ $1.php [L]
#Rule for maintaining user url
RewriteRule ^users/(.+)/(.+)/(.+)/?$ pages/$2.php?social_id=$1 [QSA]
#Initiallinzing user url
RewriteRule ^users/(.+)/?$ pages/profile.php?social_id=$1 [QSA]
#direct access to logout.php
RewriteRule ^logout logs/logout.php [QSA]
# # Use Mod_deflate to compress static files
<ifmodule mod_deflate.c>
<filesmatch ".(js|css|ico|txt|htm|html|php)$">
SetOutputFilter DEFLATE
</filesmatch>
</ifmodule>