0

I want to redirect all requests for NOT(main.php) to handelrequest.php?page=[page]
So it must be something like:

RewriteRule !(main.php) handlerequest.php?page=$1

or

RedirectMatch !(main.php) handlerequest.php?page=$1

but it seems, that those modules haven't negation at all...

May be it is possible to combine it. Some thing like:

RewriteRule (main.php\?.*) $1
RewriteRule (*) handlerequest.php?page=$1

If not main.php, else for all others the second rule become active.
Is there some solution?

Thank you for ahead.

Rodnower
  • 179
  • 3
  • 12

1 Answers1

1
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !main.php
RewriteRule ^(.*)$ handlerequest.php?page=$1

That says.. if the requested filename is main.php don't run the rule.. for everything else run the rule.

Mike
  • 21,910
  • 7
  • 55
  • 79