alexbowyer
Forum Replies Created
-
OK thanks. I have asked the campaign monitor people to update their help page, I will buy the premium version.
Thanks
AlexForum: Fixing WordPress
In reply to: How to set .htaccess correctly for 301 redirects to subdirectory.Just updating this thread for the benefit of anyone else who might end up googling their way here with a similar problem.
My ISP found me a partial solution. This redirects any URL that doesn’t correspond to a file or directory, to the subdirectory.
It will work until I need to use WordPress at the root level as well as at the subdirectory level. For a static site it works fine…
These are the .htaccess lines needed:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /blog/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L] </IfModule> # END WordPressForum: Fixing WordPress
In reply to: How to set .htaccess correctly for 301 redirects to subdirectory.I am indeed consulting the host on this as well, but to reply to your last assertion:
Something related to that site is throwing 404 errors prior to the rewrite rules.
If that were true, how do you explain the fact that blog post 1 behaves differently than blog post 2 & 3? The only difference between those posts is what’s in the .htaccess file. And if I switch the rule styles around the behaviour changes accordingly. Seems to me the .htaccess file is very much being processed, and is indeed affecting the resolution of those URLs….
Forum: Fixing WordPress
In reply to: How to set .htaccess correctly for 301 redirects to subdirectory.Thank you for your response and continuing to engage me on this.
We’ll have to agree to disagree about the 404 situation at the root URL. It’s irrelevant to the issue I am trying to fix anyway:
I think there is something from my last post that I did not clearly convey.
The reason I have left my .htaccess file with only 3 (different) redirect rules is to show both what I had, and your suggested solution, and a third solution, side by side, all still active and inspectable by you.
Let’s consider each blog post in turn, hopefully you will then see what my last post was trying to convey:
Blog post 1
Slug: fantasia-festival-2013-mini-reviews
Blog post exists at http://blog.alexbowyer.com (load the base URL, hover over first post title, look at the URL in the status bar).
Redirect rule in effect:Redirect 301 /2013/07/fantasia-festival-2013-mini-reviews/ http://blog.alexbowyer.com/2013/07/fantasia-festival-2013-mini-reviews/Result: Neither the blog.alexbowyer.com URL for this post, nor the alexbowyer.com URL for this post work. Both get “too many redirects” warning.
My interpretation: the redirect rule is being picked up a second time, because blog.alexbowyer.com exists in a subdirectory underneath the root of alexbowyer.com (where the .htaccess lives)Blog post 1 illustrates the initial problem I reported.
Blog post 2
Slug: canadian-mobile-phone-charges-5-important-questions-that-deserve-an-answer
Blog post exists at http://blog.alexbowyer.com/2013/03/canadian-mobile-phone-charges-5-important-questions-that-deserve-an-answer/ and loads fine via that URL
Redirect rule in effect (your suggestion):RedirectMatch 301 (?i)http://alexbowyer.com/2013/03/canadian-mobile-phone-charges-5-important-questions-that-deserve-an-answer/ http://blog.alexbowyer.com/2013/03/canadian-mobile-phone-charges-5-important-questions-that-deserve-an-answer/Result: When accessed via alexbowyer.com URL we get a 404.
My interpretation: the redirectMatch rule is failing to find a match, so the URL behaves exactly the same as if nothing exists at that URL.Blog post 2 illustrates your suggested fix, which so far does not work for me. Note that the blog post definitely does exist and load under blog.alexbowyer URL.
Blog post 3
Slug: science-friction-review
Blog post exists at http://blog.alexbowyer.com/2013/01/science-friction-review/ and loads fine via that URL
Redirect rule in effect (my attempt to fix it and stop circular redirection):Redirect 301 http://alexbowyer.com/2013/01/science-friction-review/ http://blog.alexbowyer.com/2013/01/science-friction-review/Result: When accessed via alexbowyer.com URL we get a 404.
My interpretation: the redirect rule is failing to find a match, so the URL behaves exactly the same as if nothing exists at that URL.Blog post 3 illustrates another attempt to fix the circular redirects problem which also does not seem to be working. Note that the blog post definitely does exist and load under blog.alexbowyer URL.
Hope this makes things clearer. Thanks again for continuing to engage me in this conversation. Hope you can help.
Forum: Fixing WordPress
In reply to: How to set .htaccess correctly for 301 redirects to subdirectory.I think you are saying the problem is that the .htaccess file is ignored when there is no index.php file to load.
To prove this is not the issue, I have installed a simple index.php file which loads phpinfo.
You can see all of the following URLs load fine (in other words both destination site and “old” site do indeed exist):
- http://alexbowyer.com/
- http://blog.alexbowyer.com/2013/03/canadian-mobile-phone-charges-5-important-questions-that-deserve-an-answer/
- http://blog.alexbowyer.com/2013/01/science-friction-review/
- You can also see by visiting http://blog.alexbowyer.com/ that the top post (slug fantasia-festival-2013-mini-reviews) does indeed exist, though it can’t be clicked on because of the redirection approach tried below.
You can see that none of the following URLs correctly load content on blog.alexbowyer.com:
- http://blog.alexbowyer.com/2013/07/fantasia-festival-2013-mini-reviews/
- http://alexbowyer.com/2013/07/fantasia-festival-2013-mini-reviews/
- http://alexbowyer.com/2013/03/canadian-mobile-phone-charges-5-important-questions-that-deserve-an-answer/
- http://alexbowyer.com/2013/01/science-friction-review/
It’s not a hosting problem nor a problem with a non-existent site, it’s a redirection problem.
Currently I have the following .htaccess rules in place (this is the entirety of the file):
Redirect 301 /2013/07/fantasia-festival-2013-mini-reviews/ http://blog.alexbowyer.com/2013/07/fantasia-festival-2013-mini-reviews/ RedirectMatch 301 (?i)http://alexbowyer.com/2013/03/canadian-mobile-phone-charges-5-important-questions-that-deserve-an-answer/ http://blog.alexbowyer.com/2013/03/canadian-mobile-phone-charges-5-important-questions-that-deserve-an-answer/ Redirect 301 http://alexbowyer.com/2013/01/science-friction-review/ http://blog.alexbowyer.com/2013/01/science-friction-review/ Options -IndexesI am sorry if my previous response was not clear enough or frustrated you somehow, but this is a genuine problem and I am struggling to find the solution online.
Any help from you or others would be appreciated.
Thanks.Forum: Fixing WordPress
In reply to: How to set .htaccess correctly for 301 redirects to subdirectory.No, I want a request to (for example)
http://alexbowyer.com/2013/07/fantasia-festival-2013-mini-reviews/to be 301 redirected to
http://blog.alexbowyer.com/2013/07/fantasia-festival-2013-mini-reviews/where the blog has been migrated to.
On the server, the alexbowyer.com site is served up from /public_html/ and the blog.alexbowyer.com is served up from /public_html/blog/
I have only one .htaccess, in the /public_html/ directory. The 404s only happen when I start the redirect match condition’s first address with http://alexbowyer.com … doesn’t happen when redirect is set to match a relative path e.g. /2013/07/fantasia-festival-2013-mini-reviews/ (I have set it back to this now so you can see the problem).
HOWEVER this breaks the ability of http://blog.alexbowyer.com/2013/07/fantasia-festival-2013-mini-reviews/ (the redirect destination) to be resolvable (presumably because the .htaccess in the parent directory is still picked up, causing the “too many redirects message” you see now I have put the file back as it was). Hope that is clearer!
Oh and the root alexbowyer.com 404 is explained because I have Options -Indexes in place and no index.php file.
Thanks for spending time helping me on this – I am stumped!!
Forum: Fixing WordPress
In reply to: How to set .htaccess correctly for 301 redirects to subdirectory.Thanks for the suggestion, I just tried it (it’s in place now) but
http://alexbowyer.com/2013/07/fantasia-festival-2013-mini-reviews/ now yields a 404 🙁
Forum: Fixing WordPress
In reply to: How to set .htaccess correctly for 301 redirects to subdirectory.Just to clarify, the problem occurs both when using one of the URLs from the original domain e.g. http://alexbowyer.com/2013/07/fantasia-festival-2013-mini-reviews/
as well as when using new URL like http://blog.alexbowyer.com/2013/07/fantasia-festival-2013-mini-reviews/ and goes away (for blog.alexbowyer.com link but not for alexbowyer.com) if I remove the Redirect line for that post, so I’m certain it’s all down to the .htaccess file.