mirror of https://github.com/phanan/htaccess.git
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:
parent
7a90f19987
commit
191fada5a5
|
@ -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)
|
- [Alias Paths to Script](#alias-paths-to-script)
|
||||||
- [Redirect an Entire Site](#redirect-an-entire-site)
|
- [Redirect an Entire Site](#redirect-an-entire-site)
|
||||||
- [Alias "Clean" URLs](#alias-clean-urls)
|
- [Alias "Clean" URLs](#alias-clean-urls)
|
||||||
|
- [Exclude a URL from Redirection](#exclude-url-from-redirection)
|
||||||
- [Security](#security)
|
- [Security](#security)
|
||||||
- [Deny All Access](#deny-all-access)
|
- [Deny All Access](#deny-all-access)
|
||||||
- [Deny All Access Except Yours](#deny-all-access-except-yours)
|
- [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/)
|
[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
|
## Security
|
||||||
### Deny All Access
|
### Deny All Access
|
||||||
``` apacheconf
|
``` apacheconf
|
||||||
|
|
Loading…
Reference in New Issue