0

I'm trying to understand the contents of an .htaccess file written by someone else. What does RewriteRule ^index\.php$ - [L] below accomplish?

RewriteCond %{QUERY_STRING} ^(.*)?$
RewriteRule ^admin/(.*)$                        index.php?type=admin&action=view&page=$1 [L]

RewriteCond %{QUERY_STRING} ^(.*)?$
RewriteRule ^login$                             index.php?action=view&type=login&%1 [L]

RewriteCond %{QUERY_STRING} ^(.*)?$
RewriteRule ^forgot-password$                   index.php?action=view&type=forgot-password&%1 [L]

RewriteCond %{QUERY_STRING} ^(.*)?$
RewriteRule ^edit/user(/)?$                     index.php?action=edit&type=user&%1 [L]

RewriteCond %{QUERY_STRING} ^(.*)?$
RewriteRule ^signup(/)?$                        index.php?action=edit&type=user&id=0&%1  [L]

RewriteCond %{QUERY_STRING} ^(.*)?$
RewriteRule ^user/([0-9]+)(/)?                  index.php?action=view&type=note&user=$1&%1 [L]

RewriteCond %{QUERY_STRING} ^(.*)?$
RewriteRule ^(suggestion|comment)/([0-9]+)(/)?  index.php?action=view&type=note&page=open&note_type=$1&note=$2&%1 [L]

RewriteCond %{QUERY_STRING} ^(.*)?$
RewriteRule ^([0-9A-Za-z\-_]+)/(suggestion|comment)/([0-9]+)(/)?    index.php?action=view&type=note&page=$1&note_type=$2&note=$3&%1 [L]

#Catch All Pages
RewriteRule ^index\.php$ - [L]

RewriteCond %{QUERY_STRING} ^(.*)?$
RewriteRule ^([0-9A-Za-z\-_]+)(/)?          index.php?action=view&type=page&page=$1&%1 [L]
thanks_in_advance
  • 2,603
  • 6
  • 28
  • 44

1 Answers1

2

It means "do nothing".

A dash indicates that no substitution should be performed (the existing path is passed through untouched). This is used when a flag (see below) needs to be applied without changing the path.

You can read similar questions here:

Apache RewriteRule, - (dash) as substitution

Hyphen in .htaccess file rewrite rule

And the mod_rewrite documentation.

Community
  • 1
  • 1
Deimoks
  • 728
  • 6
  • 20