nginx 重定向到index.php
location /keywords {
index index.php;
try_files $uri $uri/ /keywords/index.php?q=$uri&$args;
}
index index.php;
try_files $uri $uri/ /keywords/index.php?q=$uri&$args;
}
apache:
.htaccess
1 Options +FollowSymLinks 2 IndexIgnore */* 3 RewriteEngine on 4 #RewriteCond %{REQUEST_URI} !^.*(\.htm|\.xml|\.css|\.js|\.gif|\.png|\.jpg|\.jpeg|\.GIF|\.PNG|\.JPG|\.JPEG|\.DAT|\.dat|\.php)$|.*(statics).*|.*(upload).* 5 # if a directory or a file exists, use it directly 6 RewriteCond %{REQUEST_FILENAME} !-f 7 RewriteCond %{REQUEST_FILENAME} !-d 8 9 # otherwise forward it to index.php 10 RewriteRule . index.php