Apache 如何修复.htaccess
这是到目前为止我的.htaccess:Apache 如何修复.htaccess,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,这是到目前为止我的.htaccess: IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* <Limit GET POST> order deny,allow deny from all allow from all </Limit> <Limit PUT DELETE> order deny,allow deny from all </Limit> AuthName si
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName site.com
#Redirect 301 / http://www.google.com/
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^([^/\.]+)/?$ /index.php?page=$1 [L]
RewriteCond %{HTTP_HOST} ^site.com
RewriteRule (.*) http://www.site.com/$1 [R=301,L]
ErrorDocument 404 /404.html
IndexIgnore.htaccess*/.?****.\HEADER**/README**/\u vti*
命令拒绝,允许
全盘否定
通融
命令拒绝,允许
全盘否定
AuthName网站
#重定向301/http://www.google.com/
选项+FollowSymlinks
重新启动发动机
重写规则^([^/\.]+)/?$/index.php?页面=$1[L]
重写cond%{HTTP_HOST}^site.com
重写规则(.*)http://www.site.com/$1[R=301,L]
错误文档404/404.html
我想做的是:
index.php?page=pagesite->site.com/pagesite
但是如果我去site.com/images,它不会去/images,而是去index.php?page=images
我该如何解决这个问题
另外,如果“pagesite”不在/includes/pages/中,是否会重定向到404
谢谢我假设您正在尝试返回直接返回而不是通过PHP返回的图像和其他普通文件:
RewriteEngine On
# If the file exists, return it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?page=$1 [L]
至于404,由于所有其他内容都转到index.php,所以应该由php代码返回