我想将此 php url 重定向到该文件夹。
我一直使用下面的设置。但是自从 apache 更新到 2.4 之后,它就不再工作了。
目标:example.com/about.php?sub=about 或 example.com/about.php?sub= 应在浏览器中显示为 example.com/about/
我使用以下设置。
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(example.com)(:80)? [NC]
RewriteRule ^(.*) http://www.example.com/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.example.com/$1/ [L,R=301]
RewriteRule ^about/$ about.php$1 [L]
RewriteRule ^about/([A-Za-z0-9-]+)$ about.php?sub=$1 [L]
这就是我现在正在使用的...