Page 1 of 1

Redirect Manager not Redirecting www.*

Posted: Fri Jul 01, 2016 12:20 am
by JimRockford
Joomla 2.5.4

I just had to move several pages. Here is an example:

Source URL: http://mysite.com/faq
Destination URL: http://mysite.com/articles/faq

The redirect works fine if someone goes to mysite.com/faq, but if they go to www.mysite.com/faq, they will get a 404.

When I try adding an entry in the Redirect Manager for http://www... I get, "Save failed with the following error: The source URL must be unique."

If I drop the http:// and just enter www.mysite.com/faq, it will accept that, but it makes no difference. If they go to mysite.com/faq it works, but if they go to www.mysite.com/faq, it doesn't work.

To me the most logical answer was to create it as follows:

Source: faq
Destination: articles/faq

Unfortunately that yielded the same results as the others.

My .htaccess page has the following entry:

## Mod_rewrite in use.

RewriteEngine On

RewriteCond %{HTTP_HOST} ^mysite.com
RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]

Of course Use URL rewriting is set to yes.

Any advice would be greatly appreciated.

Re: Redirect Manager not Redirecting www.*

Posted: Fri Jul 01, 2016 12:40 am
by itoctopus
This problem might not be related to the redirect manager: have you tried another browser to test this? Note that if you are using FireFox, then FireFox caches the redirects (which is often confusing).

Also, are the .htaccess redirects working? So, if you visit http://mysite.com/faq , are you being redirected to http://www.mysite.com/articles/faq

Re: Redirect Manager not Redirecting www.*

Posted: Fri Jul 01, 2016 1:05 am
by JimRockford
Hi, itoctopus, and thank you for the quick reply.

I did try another browser on a different machine, but still encountered the same issue.

Also, there are no redirects in the .htaccess file.

I'm really at a loss for why faq to articles/faq won't solve the problem. I feel sure I'm not the first to encounter this, but as you know, finding a worthy solution article through Google anymore is like searching for the proverbial needle in a haystack.

Re: Redirect Manager not Redirecting www.*

Posted: Fri Jul 01, 2016 5:26 am
by itoctopus
By .htaccess redirects I meant the redirects from non-www to www. Are these working?

Re: Redirect Manager not Redirecting www.*

Posted: Fri Jul 01, 2016 2:31 pm
by JimRockford
itoctopus wrote:By .htaccess redirects I meant the redirects from non-www to www. Are these working?
I'm sorry; i misunderstood. I thought you were asking if I had put redirects for each page in the .htaccess file. I guess I had been up too long.

Yes, the redirect is working. If I go to mysite.com, it will redirect me to www.mysite.com.

Thanks again.

Re: Redirect Manager not Redirecting www.*

Posted: Fri Jul 01, 2016 7:49 pm
by itoctopus
This is odd - if you go to: mysite.com/faq then you should be redirected to http://www.mysite.com/faq and then be redirected in the redirect manager (the .htaccess rule must be triggered first, and then the Joomla rule). Since the redirect manager is not redirecting the www, then this means it should never work for you, but it is working.

When you go mysite.com/faq are you ultimately being redirect to mysite.com/articles/faq or to http://www.mysite.com/articles/faq

If your website is SFW, then please share its link here.

Re: Redirect Manager not Redirecting www.*

Posted: Fri Jul 01, 2016 8:34 pm
by JimRockford
I agree it's very odd. I suppose I could update the 20 or so pages in .htaccess, but just shouldn't have to do it that way.
itoctopus wrote: When you go mysite.com/faq are you ultimately being redirect to mysite.com/articles/faq or to http://www.mysite.com/articles/faq
I went to a new workstation to make sure I was clear of all cache issues and it seems that Firefox is the only thing that redirects at least half of the time.

If I go to mysite.com/faq in Firefox i get transferred to www.mysite.com/articles/faq

If I go to mysite.com/faq in IE or Chrome i get a 404

If I go to www.mysite.com/faq in Firefox I get a 404.

If I go to www.mysite.com/faq in IE or Chrome I get a 404

The site is offline while I finish all of the updates right now. If it would help you though I could create a login.

Re: Redirect Manager not Redirecting www.*

Posted: Sat Jul 02, 2016 2:17 pm
by itoctopus
That's the cause of the issue - it is the fact that the website is offline. The issue is it seems that you are logged in using mysite.com and not www.mysite.com, which means that when the redirect happens, you are using a different session, and hence the website will appear offline for you (the website will only appear online for you as a logged in super user).

The fact that it is working on FireFox might be because you are logged in to both mysite.com and www.mysite.com.

Re: Redirect Manager not Redirecting www.*

Posted: Sat Jul 02, 2016 9:23 pm
by JimRockford
Well you were partially correct in that the site being offline did have some sort of affect, though I'm ashamed to say that never crossed my mind.

I put the site back online temporarily and the results were certainly not what I expected. When the site is online, none of the redirects work. It doesn't matter if I'm using Chrome, Firefox, or IE. It also doesn't matter if I use mysite.com or http://www.mysite.com.

When in the Redirect Manager, I do have a green confirmation at the bottom of the page that says, "The Redirect Plug-in is enabled."

I did go in and try disabling and re-enabling the Redirect Manager. When the Redirect Manager is disabled, and you try to go to a redirected page, you're taken to the home page, and at the very top there is a banner that reads, "Article not found. You are not authorized to view this resource."

Then when I re-enable the Redirect Manager, we're back to getting the 404. Of course if you try redirecting a valid page, it just ignores the redirect and goes straight to the valid page.

I have this same layout for a site running on a different domain and upon checking, it's doing the same thing.

Added: The fact that it goes to the home page when redirect is not enabled, but goes to a 404 when it is enables seems to me to indicate that the redirect manager is taking control of the page and trying, but it's not getting it there.

Any ideas?

Re: Redirect Manager not Redirecting www.*

Posted: Sat Jul 02, 2016 9:50 pm
by JimRockford
You're not going to believe this, but it appears that it may only work if they get added automatically because someone tried to go to the old link and the entry gets auto generated. If that's the case, what good is the "+ NEW" button?

I'm about to use a script to create a list of all the old URLs, put them into HMTL, click them and test. I'll keep you posted.

Re: Redirect Manager not Redirecting www.*

Posted: Sun Jul 03, 2016 12:14 am
by JimRockford
Well as insane as this sounds, here is how I fixed the problem:

I deleted all the entries I'd made in Redirect Manager.

Using Notepad I made an html file with hyperlinks to all the old links; the ones that were no longer good. Then I clicked each one each one of them which took me to a 404 Error. I kept doing that until all of the old links appeared in Redirect Manager.

After that I edited each entry in Redirect Manager, adding the new URL for each record.

Now the only issue is that on redirect, up at the top of the page the user will usually see, "Error loading component: , 1" It goes away on reload, and as I recall this issue what that showing up at the very top as been around for years. Everyone complains about it, but I've never seen a fix.

For whatever reason, the Redirect Manager is only accepting entries that it puts there automatically. That said, I'm not sure what the New button is there for if they don't work, but when you just google, Joomla Redirect Manager not working, you find a lot of people who can't make their redirects work.

Thanks for helping me think this thing out.