From 191fada5a56732cde8f4cc0c5060d2b6c9780d58 Mon Sep 17 00:00:00 2001 From: whiskeyJak Date: Sun, 28 Oct 2018 10:50:41 -0600 Subject: [PATCH] Adding a snippet on how to exclude a URL from redirection (#90) * rewrite and redireciton: add snippet for excluding a url * formatting --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index aa6fa42..99e1d94 100644 --- a/README.md +++ b/README.md @@ -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