views:

30

answers:

2

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.php

+1  A: 
RewriteRule ^about/?$ /about_us.php
Artefacto
+2  A: 

It'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
umop