mirror of
https://github.com/phanan/htaccess.git
synced 2018-11-08 13:39:40 +01:00
Add Redirect an Entire Site without Links section
This commit is contained in:
parent
0caec9ddce
commit
1e4fe616e0
1 changed files with 9 additions and 2 deletions
11
README.md
11
README.md
|
@ -22,7 +22,8 @@ What we are doing here is mostly collecting useful snippets from all over the in
|
||||||
- [Redirect Using RedirectMatch](#redirect-using-redirectmatch)
|
- [Redirect Using RedirectMatch](#redirect-using-redirectmatch)
|
||||||
- [Alias a Single Directory](#alias-a-single-directory)
|
- [Alias a Single Directory](#alias-a-single-directory)
|
||||||
- [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 with Links](#redirect-an-entire-site-with-links)
|
||||||
|
- [Redirect an Entire Site without Links](#redirect-an-entire-site-without-links)
|
||||||
- [Alias "Clean" URLs](#alias-clean-urls)
|
- [Alias "Clean" URLs](#alias-clean-urls)
|
||||||
- [Security](#security)
|
- [Security](#security)
|
||||||
- [Deny All Access](#deny-all-access)
|
- [Deny All Access](#deny-all-access)
|
||||||
|
@ -166,12 +167,18 @@ RewriteRule ^(.*)$ index.fcgi/$1 [QSA,L]
|
||||||
```
|
```
|
||||||
This is a less efficient version of the FallbackResource directive (because using `mod_rewrite` is more complex than just handling the `FallbackResource` directive), but it’s also more flexible.
|
This is a less efficient version of the FallbackResource directive (because using `mod_rewrite` is more complex than just handling the `FallbackResource` directive), but it’s also more flexible.
|
||||||
|
|
||||||
### Redirect an Entire Site
|
### Redirect an Entire Site with Links
|
||||||
``` apacheconf
|
``` apacheconf
|
||||||
Redirect 301 / http://newsite.com/
|
Redirect 301 / http://newsite.com/
|
||||||
```
|
```
|
||||||
This way does it with links intact. That is `www.oldsite.com/some/crazy/link.html` will become `www.newsite.com/some/crazy/link.html`. This is extremely helpful when you are just “moving” a site to a new domain. [Source](http://css-tricks.com/snippets/htaccess/301-redirects/)
|
This way does it with links intact. That is `www.oldsite.com/some/crazy/link.html` will become `www.newsite.com/some/crazy/link.html`. This is extremely helpful when you are just “moving” a site to a new domain. [Source](http://css-tricks.com/snippets/htaccess/301-redirects/)
|
||||||
|
|
||||||
|
### Redirect an Entire Site without Links
|
||||||
|
``` apacheconf
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteRule ^(.*)$ http://newsite.com/
|
||||||
|
```
|
||||||
|
|
||||||
### Alias “Clean” URLs
|
### Alias “Clean” URLs
|
||||||
This snippet lets you use “clean” URLs -- those without a PHP extension, e.g. `example.com/users` instead of `example.com/users.php`.
|
This snippet lets you use “clean” URLs -- those without a PHP extension, e.g. `example.com/users` instead of `example.com/users.php`.
|
||||||
``` apacheconf
|
``` apacheconf
|
||||||
|
|
Loading…
Reference in a new issue