2 haharen Feb 19, 2016 01:38

So I'm trying to simply redirect a post from b2evo to a new url which is a static page elsewhere on my site. How would you do this? The thread I referenced above indicates it can be done, but it doesn't seem to be working for me.
The manual area you referenced I looked at and it states:
> Redirected Posts
This is designed for content that has moved to another place (typically another site). You can enter an URL in the "Link to Url" field in expert mode and then set the status to Redirected.
Front office: trying to access the post (by any user) will redirect (301) to the destination URL
It isn't redirecting as the manual states it should.
Reading more on the forum, I don't seem to have a choice to switch to "expert mode" which might be the problem, But I'm not sure if that's still relevant in v 6.6.7.
So I'm trying to simply redirect a post from b2evo to a new url which is a static page elsewhere on my site. How would you do this? The thread I referenced above indicates it can be done, but it doesn't seem to be working for me.
I don't know how to do that. (Maybe there is no such function now, or could be done by some configuration.But does that make sense?)
However you can make the post as a sidebar link, and list it in the sidebar. (or other striking place by using the Widget)
I want to be able to have the page redirect to the new page when I load the old url into a web browser. I appreciate your help haharen, but I don't think you understand what I'm asking.
http://thek9guy.com/dog_blog/ddn.php
FWIW I'm using a stub file for that page.
Yes, the new url is in there and it's simply showing an error page "Sorry, nothing to display". I added above that I'm using a stub file for this page, so not sure if that could be the issue.
@vapor
Please find the post in the back-office which you set to "Redirected", then click the permalink, to see if it's working or not.
Yes, the permalink in the back office IS working as desired.
@vapor
Now let us take a analysis.
You used the stub file 'http://thek9guy.com/dog_blog/ddn.php' for an page post, but now the post is out of date and should be redirected to another page.So set the page as a 'Redirected' type and also input the new URL, then visit the stub file 'http://thek9guy.com/dog_blog/ddn.php' , it can't work correctly. But when you click the permalink of the old page post, it would be OK.
So, I guess the problem is in the file : 'ddn.php'. I don't know how you take the stub file as the old post page. However you may check it out to find if the old page url is really the permalink of the old page post, or just replace it to the new URL which you want to redirect to.
It now seems to be working. I only had one post on that blog - once I added a second post it began working properly. Not sure whether this is a bug or not. I had removed the stub file and reconfigured my url settings - had the same issue with or without it. Didn't seem to be a stub file issue.
Thanks for your help.
@vapor ,
Yes, you're right, the first post of one collection can't be 'Redirected' to the new URL but showing the front page of that collection. Then following posts(second , third...) which set to 'Redirected' would be OK.
I use the b2evolution 6.7.0-alpha for this test. Maybe it's a bug.
@vapor maybe, a direct 301 redirection rule included into your .htaccess file would be a better idea than using b2evolution's internal redirect mechanisms (zero php processing + no database load on each visit).
However, I can't reproduce what you said, so please let me tell you what I did and correct me if I did not follow your real scenario in order to find out a potential bug, as @haharen said.
I got redirected correctly when I go to http://example.com/stubfile.php.
Am I missing something?
@mgsolipa
It's really weird that sometimes we can't catch the exception. When I used b2 which no test data installed for testing, everything is OK.
But if I use another b2 which already had test data(the first blog named "BlogA") generated by the installation procedure, then I change the first post: 《Main Intro post》 to the "Redirected" type, the problem occored, as follow:
The first post of one collection can't be 'Redirected' to the new URL but showing the front page of that collection. Then following posts(second , third...) which set to 'Redirected' would be OK.
Hi @vapor ,
As you see, the property of "Redirected" is the visiable state of a post which would never be seen in the front-office. So when you set "View blog after publishing" as "View new post" in the back-office, you would get "Sorry, nothing here to display" message.However you can see and edit it in the the back-office.
I know now you get the question : What is the meaning of it?
I guess, it's no sense for the new topic, but get the meaning of old ones which have been referenced by other articles. When the old post has been moved to other site(or other situations), you can edit it as a "Redirected" post, then all the referenced links in other posts would be redirected to the new url.
This is my understanding. You may also would like to check out the manual help : http://b2evolution.net/man/visibility-status