2
0
Fork 0
mirror of https://github.com/phanan/htaccess.git synced 2018-11-08 13:39:40 +01:00

Adding a snippet on how to exclude a URL from redirection (#90)

* rewrite and redireciton: add snippet for excluding a url

* formatting
This commit is contained in:
whiskeyJak 2018-10-28 10:50:41 -06:00 committed by Phan An
parent 7a90f19987
commit 191fada5a5

View file

@ -26,6 +26,7 @@ What we are doing here is mostly collecting useful snippets from all over the in
- [Alias Paths to Script](#alias-paths-to-script)
- [Redirect an Entire Site](#redirect-an-entire-site)
- [Alias "Clean" URLs](#alias-clean-urls)
- [Exclude a URL from Redirection](#exclude-url-from-redirection)
- [Security](#security)
- [Deny All Access](#deny-all-access)
- [Deny All Access Except Yours](#deny-all-access-except-yours)
@ -184,6 +185,13 @@ RewriteRule ^([^.]+)$ $1.php [NC,L]
```
[Source](http://www.abeautifulsite.net/access-pages-without-the-php-extension-using-htaccess/)
### Exclude URL from Redirection
This snippet allows you to exclude a URL from redirection. For example, if you have redirection rules setup but want to exclude robots.txt so search engines can access that URL as expected.
``` apacheconf
RewriteEngine On
RewriteRule ^robots.txt - [L]
```
## Security
### Deny All Access
``` apacheconf