Quote:
Originally Posted by L a r r y
Code:
RedirectMatch Permanent ^/blog(/)?$ http://www.webdesigncut.com/blog/
I will investigate the use of RewriteRules to achieve this goal and see if I can determine what went wrong with the OP's original efforts and post again in this thread with those results.
|
I found this RewriteRule accomplishes the same thing as my RedirectMatch:
Code:
RewriteRule ^blog(/)?$ http://www.webdesigncut.com/blog/ [R=302,L]
I tested it in my website's root .htaccess, and it goes to the OP's webdesigncut blog. I can enter (mydomain)/blog or (mydomain/blog/ and it sends me to the websesigncut page.
As written I used code 302 for a temporary redirect as opposed to the 301 code, which would make the redirect permanent.
I did not specify any RewriteCond conditions ahead of my Rule.
The RewriteRule does not require the leading slash as does the RedirectMatch option that I laid out in my earlier post.
Going back to the original post, of the several attempts listed, the RewriteRule was drawn up in error in each case, because the right side argument of the RewriteRule is a straightforward URL as it should appear in the browser's address field, starting with
http:// and ending with
/blog/ There is no use of regex in the output URL, therefore no need for escaping with the backslash (the \ character).
In reviewing the thread, I gave some advice to check "this" tutorial "over here" and suggested using http:// instead, but I should have advised to not use any backslashes. OP responded with a RewriteRule that still contained backslashes, and it therefore failed. I was not as complete with my advice and my depth of understanding of the subject was lacking.
I hope this post helps clarify the problem, and I will see if I can contact the OP through his site if he does not respond here or fix the problem with the two sites linked in his first post.