i digg on the internet about .htaccess and rewrite rules i need to do with my site.
i saw something i dont understand and want to know what it means
i am wondering what is the difference between the 2 regular expression that i need to use for my site among all others i need to use):
RewriteRule ^home$ mainpage.php?id=$1 [QSA]
and
RewriteRule ^home(/)?$ mainpage.php?id=$1 [L]
i looked at the QSA and L but what the (/) means?
The expression will be
(/)?not(/). It means slash or not on the URL. These two URLs will go to the same place:http://www.domain.com/home/and
So the slash is optional. This way, if a bot or a search engine puts it, the rule will work.
You can rewrite the rules like this:
Also, I saw you said:
If all your pages goes to the same file (in this case mainpage.php), you can create one rule that will automatically rewrites them instead of creating 10 or 15 rules (or more). You can do this like this:
This rule will use Letters, Numbers, Dash and Underscores as the page.