moved forum to root from /forum/ how to 301 redirect?
I have moved my forum to root from /forum/ and I understand this may be extremely obvious and im almost there but how to do this exactly? I need to redirect all pages to the new location in root...
Currently I am using redirect 301 /forum/ http://www.kaohsiungliving.org/
in .htaccess and it almost works but misses out the forward flash / before /discussion folder. Example.
http://www.kaohsiungliving.orgdiscussion/715/question-what-would-you-think-of-a-counselling-service-for-ex-pats/p1?p=discussion/715/question-what-would-you-think-of-a-counselling-service-for-ex-pats/p1
As you can see "www.kaohsiungliving.orgdiscussion/" no "/" before discussion This is probably an extremely easy thing to do, and I have googled away but have only found partial success.
Please help
There was an error rendering this rich post.
Answers
grep is your friend.
doesnt work - still no "/" before discussion folder. Redirects conversations without the "/" look closely at the redirected discussion url below:
http://www.kaohsiungliving.orgdiscussion/715/question-what-would-you-think-of-a-counselling-service-for-ex-pats/p1?p=discussion/715/question-what-would-you-think-of-a-counselling-service-for-ex-pats/p1
There was an error rendering this rich post.
@x00 thank you so much! its working like vanilla! one question though, what kind of redirect is this? I should be using 301, I think?
There was an error rendering this rich post.
to redirect all uri
another way
grep is your friend.
Damn it! now its adding "/?p=forum/" before /discussion hence not redirecting properly. Example below.
http://www.kaohsiungliving.org/?p=forum/discussion/710/native-american-english-teacher-looking-for-afternoon-evening-cram-school/p1
There was an error rendering this rich post.
show the whole .htacess contents. Use <pre> tags. You have most like got thing in the wrong order.
grep is your friend.
thank you for your time!
There was an error rendering this rich post.
its missing parts of the .htaccess above, ill try pasting again:
this ^ is exactly how my .htaccess looks.
There was an error rendering this rich post.
using
RedirectMatch 301 ^/forum/(.*) http://www.kaohsiungliving.org/$1
i get a double up of the discussion url - for example:http://www.kaohsiungliving.org/discussion/648/short-term-high-pay-public-teaching-position-in-china/p1?p=forum/discussion/648/short-term-high-pay-public-teaching-position-in-china/p1
again - its almost there im so close...why has it duplicated the discussion part of the url?
been trying to get this working for 3 hours now with only partial success...
There was an error rendering this rich post.
I have a solution. Vanilla routes.
First comment out the RedirectMatch in .htaccess
then go to dashboard/routes -> Add Route
Route Expression:
forum(/.*)
Target:
$1
Type:
Permanent 301
Done!
Yes it is internal conflict of interest to answer your question.
grep is your friend.
YEEEEEEEEEEEEEEEEEEEEEEEEEES!!!! If i wasnt a raging HETROSEXUAL - I would give you a big kiss!!
6 hours of PAIN come to an end!
There was an error rendering this rich post.
Can you share what worked for you?