By Bernard Arias on Thursday, 04 September 2014
Posted in Technical Issues
Replies 15
Likes 0
Views 751
Votes 0
Hello Stackideas Support,

I have imported Wordpress for Joomla content and I need to redirect some old indexed links formatted in Wordpress shortlink format. But it's not redirecting. Instead Easyblog displays recent blog posts.

The links I want to redirect look like this:

http://sexyg2.sairabydesign.com/blog/?p=5733

I am using Joomla's redirect plugin to redirect these to their permalink equivalent address on EasyBlog, formatted like this:

http://sexyg2.sairabydesign.com/blog/entry/2014/07/30/you-know-you-want-it-my-story-in-the-latest-cleis-press-erotica-collection

Easyblog seems to capture the 404 and displays the default list of Recent Blog Posts. How can I change this behavior so Easyblog lets Joomla handle redirects?

Thank you,
Hello Bernard,

Currently in EasyBlog 3.9, we do perform a 301 redirection automatically to the front page of EasyBlog. In EasyBlog 5, we'll be changing this behavior so that it raises a 404 error. If you want, I could add some hacks for your site but I would need the FTP access to the site.
·
Thursday, 04 September 2014 12:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks, Mark. The FTP account is included.

Please let me know the hacks you perform so I can apply the same to the production environment.

Thank you, in advanced.

Bernard
·
Thursday, 04 September 2014 13:57
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Bernard,

I am really sorry for the delay of my reply, I was trying to add the codes for you earlier today until the internet in our office suddenly decided to gave up on us I have applied some codes on your site in the file /components/com_easyblog/views/entry/view.html.php so that it generates a 404 error if an invalid blog post is being accessed.

Can you give this a try again?
·
Friday, 05 September 2014 02:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

Thank you for the update. It's still not opening the destination post. It continues to show Recent Blog Posts. The URL doesn't change. Here is the test I've set up so you can quickly check the behavior:

Source URL: http://sexyg2.sairabydesign.com/blog/?p=5733
Destination URL: http://sexyg2.sairabydesign.com/blog/entry/2014/07/30/you-know-you-want-it-my-story-in-the-latest-cleis-press-erotica-collection/

Let me know what I can do.

Thank you,
·
Friday, 05 September 2014 05:41
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Bernard,

Hm, sorry I might have misunderstood your initial request earlier as I thought you were referring to 404 errors not being generated by EasyBlog. However, reading your post again (My bad, for misinterpreting it incorrectly), it looks like you have setup redirects from old Wordpress URLs to EasyBlog relevant URLs? May I know how is this URL redirection being added on the site?
·
Friday, 05 September 2014 12:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

These are added through Joomla's Redirect component. But Joomla is not seeing 404's for these URL's because EasyBlog appears to be intercepting 404 errors generated in it's path. It's not generating 404 even though the paths don't exist in Easyblog.

I think you were on the right track.
·
Friday, 05 September 2014 12:59
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Bernard Arias,

Sorry for late reply to this,
I have tried to access in your Joomla backend, but i hitting this :
Username and password do not match or you do not have an account yet.

It seems like you provided that login credential is not working, please advise.
·
Friday, 05 September 2014 15:14
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

I've reset the password as shown in site details.

Thank you,
·
Saturday, 06 September 2014 00:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Bernard,

I am really sorry for the delay of this reply as it is a weekend for us here.
I'm still unable to access in your frontend and backend account Is it possible create another new Superuser user account so we can help you check on this quickly? Please advise.
·
Saturday, 06 September 2014 19:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

I forget that the email is not the login. The login is below with the earlier provided password.
·
Sunday, 07 September 2014 14:50
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Bernard,

I am really sorry for the delay of this reply as it is a weekend for us here. Okay, I have fully understood this issue and it's actually not an issue with EasyBlog because you are using a custom query string like p=1234 . Since this query string does not exist in EasyBlog, there's no reason to throw a 404 error since you can actually type any query string in the address bar and if it needs to check all these parameters, it's going to be extremely heavy.

What I have done for you on your site instead, is to hack the codes in /components/com_easyblog/views/latest/view.html.php and added the codes at line 38 onwards,


$p = JRequest::getVar('p');

if ($p) {
return JError::raiseError(404, 'Invalid');
}



This is done so that if there's a query string that uses p=1234 , it will throw a 404 error instead.
·
Sunday, 07 September 2014 21:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you, Mark. That fixed it. Joomla's redirect is catching those URLs. Perfect!

I think I understand the reason this couldn't work any differently than designed. This does make moving Wordpress to Easyblog a little tricky for folks who've had a long online history. That's my client, and she will be very appreciative of the extra care and thought you gave to this.

Thank you!
·
Tuesday, 09 September 2014 08:23
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Bernard,

You are most welcome
·
Tuesday, 09 September 2014 10:30
·
0 Likes
·
0 Votes
·
0 Comments
·
My page does not show this on line 38 at all Mark?

What I have done for you on your site instead, is to hack the codes in /components/com_easyblog/views/latest/view.html.php and added the codes at line 38 onwards,


are you sure thats the path?
my easyblog version is 3.9.18613
·
Saturday, 13 December 2014 02:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Wes,

It is not something that already been there. I believe Mark has added the code on line 38. You might want copy the code given and paste it here: http://screen.stackideas.com/2014-12-13_1147.png
·
Saturday, 13 December 2014 11:48
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post