Last active
February 18, 2016 02:57
-
-
Save zellwk/e222902ecfb555cfcfc4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Redirects I hope to achieve: | |
- http://zell-weekeat.com/ -> http://zellwk.com/ | |
- http://zell-weekeat.com/about -> http://zellwk.com/about | |
- http://zell-weekeat.com/about/ -> http://zellwk.com/about | |
- http://zell-weekeat.com/wp-admin/* -> http://zell-weekeat.com/wp-admin/* | |
- http://zell-weekeat.com/wp-content/* -> http://zell-weekeat.com/wp-content/* | |
- http://zell-weekeat.com/* -> http://zellwk.com/blog/* | |
- http://zell-weekeat.com/*/ -> http://zellwk.com/blog/* | |
## Present Condition | |
The present condition is that all urls are routed from zell-weekeat.com/ to zell-weekeat.com /zellwk/ | |
``` | |
- public_html/ | |
|- zellwk/ | |
|- my current files | |
``` | |
The .htaccess is: | |
``` | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^(www.)?zell-weekeat.com$ | |
RewriteCond %{REQUEST_URI} !^/zellwk/ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ /zellwk/$1 | |
RewriteCond %{HTTP_HOST} ^(www.)?zell-weekeat.com$ | |
``` | |
## What I've tried: | |
``` | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^(www.)?zell-weekeat.com$ | |
RewriteRule about(/)$ http://zellwk.com/about [R=301] | |
RewriteCond %{REQUEST_URI} !^/zellwk/ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule /wp-admin/(.*) /zellwk/wp-admin/$1 | |
RewriteRule /wp-content/uploads/(.*) /zellwk/wp-content/uploads/$1 [L] | |
RewriteRule ^(.*)$ http://zellwk.com/blog/$1 | |
RewriteCond %{HTTP_HOST} ^(www.)?zell-weekeat.com$ | |
``` | |
URL redirection failled totally. `/about` went to something like `http://zellwk.com/blog/about` or `http://zellwk.com/blog/http:zellwk.com/about`. | |
Any help would be greatly appreciated! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's the solution that worked. Thanks to @simkimsia