如何在PHP中借助.htaccess重定向多个文件

时间:2019-02-20 09:52:32

标签: php .htaccess

<!-- multiple redirection of file  is not working -->
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)$ category.php?catname=$1 [L,N]

RewriteCond %{QUERY_STRING} !-d
RewriteCond %{QUERY_STRING} !-f
RewriteRule ^(.*)$ fullview.php?view=$1 [L]
<!--end -->

1 个答案:

答案 0 :(得分:0)

只需替换您的根文件夹

RewriteEngine on
RewriteBase /Your root folder name
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]