Whats wrong with htaccess?



我在.htaccess文件中具有此代码:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
RewriteRule ^/pages/(.*)$ ^/pages?url=$1$

site.com/pages/test-name服务器上的用户必须获取为site.com/pages?url=myurl时我的问题是什么?

以这种方式拥有它:

Options -MultiViews
RewriteEngine on
RewriteRule ^pages/(.+)$ /pages.php?url=$1 [L,QSA,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [L]

最新更新