[英]mod_rewrite URL rewriting with or without Slash
写出.htacess的正确方法是什么,以便www.domain.com/about_us和www.domain.com/about_us/访问www.domain.com/about_us.php
目前,我所拥有的是以下内容,只是想知道是否有办法将它放在一行中
选项+ FollowSymLinks
RewriteEngine on
RewriteRule ^(about)$ /about_us.php
RewriteRule ^(about /)$ /about_us.php
这是一个正则表达式,所以添加? 之后/将进行/可选(0或1次出现)。 此外,括号是不必要的:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^about/?$ /about_us.php
RewriteRule ^about/?$ /about_us.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.