tags:

views:

22

answers:

2

i have 2 line want make it one line and do the same job

RewriteRule ^account/?$ account.php
RewriteRule ^account/(.*)/?$ account.php?mod=$1

how i can do it

+1  A: 
RewriteRule ^account/(.*)/?$ account.php?mod=$1

is enough if account.php can deal with an empty mod, otherwise you will need both rules.

Ignacio Vazquez-Abrams
+2  A: 

The real merge of both rules would be:

RewriteRule ^account/?(.*)/?$ account.php?mod=$1

but it will not behave as you expect if you have URLs like account-info/foo/ which will then be mapped to account.php?mod=-info/foo.

If you have other URLs starting with account, go with Ignacio Vazquez-Abrams' answer.

Felix Kling
oh god i want it like that account.php?mod=foo
moustafa
@moustafa: I know, what do you mean with your comment?
Felix Kling