Home Apache mod_rewrite: How to "whitelist" urls?
Reply: 0

Apache mod_rewrite: How to "whitelist" urls?

user672 Published in July 15, 2018, 9:19 pm

I'm using mod_rewrite to get better urls. So currently there are two ways to access a page:

  • Direct Access: http://example.org/mypage.php
  • Access with mod_rewrite: http://example.org/startpage

The only way possible to access the site should be with mod_rewrite. In other words, I want to "whitelist" certain uris and block every different uri.

I thought about having a list of RewriteRules with "END" flag, so if none of the above rules matches, the last one will block the request. This works, but it also blocks my index.php site. Furthermore, this doesn't "feel" like the best way to do it.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.311303 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO