What is the correct way to write out the .htacess so that both www.domain.com/about_us and www.domain.com/about_us/ goes to www.domain.com/about_us.php
Currently, what I have is the below and just wonder if there's a way to put it in one 开发者_运维知识库line
Options +FollowSymLinks
RewriteEngine on RewriteRule ^(about)$ /about_us.php RewriteRule ^(about/)$ /about_us.phpIt's a regular expression, so adding ? after the / will make the / optional (0 or 1 occurrences). Also, the parenthesis are unnecessary:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^about/?$ /about_us.php
RewriteRule ^about/?$ /about_us.php
精彩评论