5
我想重寫所有www.site.com/hello to www.site.com/index.php?p=hello
,並將它與下面的代碼工作(在.htaccess
):的RewriteCond負條件
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]*)/?$ /index.php?p=$1
但我想繼續工作,所以www.site.com/?p=hello
將留www.site.com/?p=hello
我嘗試下面的代碼,但它不會工作
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\?p=)
RewriteRule ^([^/]*)/?$ /index.php?p=$1