Summary


Steps to reproduce:

 

1. Install Joomla in a subdirectory, e.g. www.mysite.com/subdir/joomla.

 

2. Rewrite requests using .htaccess rules at website top level, e.g. public_html, to make links appear as www.mysite.com/somepage, rather than their true location at www.mysite.com/subdir/somepage. Add the following rules to the site's (not Joomla's) top level .htaccess file:

 

# This section must come first!

# Add trailing slash if path does not contain a period or end with a slash

RewriteCond %{REQUEST_URI} !(\.|/$)

RewriteRule (.*) http\://www\.mysite\.com/$1/ [R=301,L]

 

# Rewrites http://www.yoursite.com/subdir to http://www.yoursite.com/

RewriteCond %{REQUEST_URI} !^/subdir

RewriteRule ^(.*)$ subdir/$1 [L]

 

3. Access the site below top level, e.g. www.mysite.com/somepage, and all is fine.

 

4. Access the site at top level, e.g. www.mysite.com, and there is a problem. The page displays ok, but links appear as www.mysite.com/subdir/somepage, rather than www.mysite.com/somepage, and fail to open. I believe the links effectively point to www.mysite.com/subdir/subdir/somepage, though I have limited debugging options on my live site.

 

This all worked fine with Joomla 3.1.5 and earlier, but is now broken for 3.2.0 on my live site. It continues to work perfectly with 3.2.0 on my local development site and on my remote test site, which do not use this request rewriting technique, so it something to do with the rewrite. I have also verified that the problem is present using Safari 6.x. Please help.
Opened On:
2 Jan 2014, 6:59 by Rob Smith
Closed On:
22 Aug 2014, 5:41
Status:
Closed

Filed Under

  • Apache 2.2.x
  • Firefox 6.x
  • MySQL 5.1.x
  • No Platform Implications
  • PHP 5.3.x
  • Search Engine Friendly

Responses

Posted on 2 Jan 2014, 8:53 by Tobias Zulauf

Hi Rob,

please retest it after a Update to 3.2.1 as we have fix there over 125 Bugs.

If you have stil the same problem please retest it with at a new Test Installation after a Backup with the last Nightly Builds (you can choose the update package: Joomla 3.2.x to 3.2.2 dev Development Patch Package.zip):

Joomla! Nightly Builds

http://developer.joomla.org/cms-packages/

Thanks :)
Posted on 2 Jan 2014, 9:33 by Rob Smith

Hi Tobias,

Way ahead of you ;-) I've just been updating to 3.2.1 and creating a backup.

I can confirm that the same problem still exists.

It's currently online at www.awayteam.co.uk, but I'll revert back to an older version shortly as this is my live site. Unfortunately, it's the only place I can reproduce the problem, which is making life a little difficult.

I've just downloaded the 3.2.2 dev patch, so will give that a try too and let you know the result shortly.

Rob
Posted on 2 Jan 2014, 9:48 by Rob Smith

Hi Tobias,

I can confirm that 3.2.2-dev also has the same problem.

Please advise.

Rob
Posted on 2 Jan 2014, 12:58 by Rob Smith

Hi Tobias,

In an effort to diagnose this further, I switched off Admin->System->Global Configuration->Site->SEO Settings->Search Engine Friendly URLs.

This makes my site work correctly again, though without SEF links. I would like to use these, but it's a temporary fix and allows your developers to see my (broken) v3.2.1 site at www.awayteam.co.uk without inconveniencing my customers too much.

 

In addition, I noticed that the two 'home' links in the top menu behave differently to each other, which may be significant.

1. The 'Home' button goes to http://www.awayteam.co.uk/index.php?lang=en

2. The Away Team logo goes to http://www.awayteam.co.uk/joomla30/index.php?lang=en

 

I've also experimented with turning off Admin->System->Global Configuration->Site->SEO Settings->Use URL rewriting, but this does not cause a problem, so I have left it on.

 

Hope this helps. Please advise.

 

Rob
Posted on 6 Jan 2014, 4:59 by Rob Smith

Hi Tobias,

I think this bug should be recategorised as 'Search Engine Friendly', as that appears to be the root cause - see my previous comment.

The status is currently 'information required.' Are you still awaiting further information from me and, if so, what do you need?

Please let me know. Thanks.

Rob
Posted on 6 Jan 2014, 5:57 by Tobias Zulauf

Hi

>I think this bug should be recategorised as 'Search Engine Friendly',

done

>The status is currently 'information required.' Are you still awaiting further information from me and, if so, what do you need

Back to open.

 

 
Posted on 6 Jan 2014, 6:00 by Tobias Zulauf

>1. The 'Home' button goes to http://www.awayteam.co.uk/index.php?lang=en

>2. The Away Team logo goes to http://www.awayteam.co.uk/joomla30/index.php?lang=en

hmm looks strange for me the logo (http://www.awayteam.co.uk/images/at_banner.png) point to http://www.awayteam.co.uk/ but open: http://www.awayteam.co.uk/joomla30/index.php?lang=en

So i can confirm your issue. But sorry i have no idea how to fix this.

You are sure that it was no issue with the .htaccess rules?


I move this here to confirmed.
Posted on 8 Feb 2014, 17:51 by Pietro Valocchi

Not to be considered a solution, but just to help the troubleshooting: you can mask the homepage error forcing the HTTP_HOST in root .htaccess to be different from the live_site in configuration.php; i.e.:

- configuration 1:

in root .htaccess

 

RewriteCond %{HTTP_HOST} ^www.domain.ext$

RewriteRule ^/?(.*)$ http://domain.ext/$1 [R=301,L]

 

in configuration.php

public $live_site = 'http://www.domain.ext/';


- configuration 2:

in root .htaccess

 

RewriteCond %{HTTP_HOST} ^domain.ext$

RewriteRule ^/?(.*)$ http://www.domain.ext/$1 [R=301,L]

 

in configuration.php

public $live_site = 'http://domain.ext/';

 


 
Posted on 9 Feb 2014, 6:17 by Rob Smith

Hi Pietro,

I've modified my live site's public_html/.htaccess and attached a copy. I believe this follows your configuration 1 idea, and should help with your analysis.

Please advise.

 

Rob
Posted on 9 Feb 2014, 6:54 by Pietro Valocchi

Hi Rob,

the configuration seems the same I tested: are your home links fixed now enabling the SEF option?

Pietro
Posted on 9 Feb 2014, 8:14 by Rob Smith

Hi Pietro,

I'm afraid I can't say, as the .htaccess change appears to have broken my live site. No images are loading, though the page layout and text is okay. Also, I can't access the Joomla admin controls, as that's now generating errors with missing files.

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (chosen.css, line 0)

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (mootools-core.js, line 0)

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (core.js, line 0)

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (jquery.min.js, line 0)

etc.

 

I suspect that requests are not being redirected to my subdirectory, as I can see that the image paths are correct and the files are present. Also, the http requests look wrong, e.g. http://www.awayteam.co.uk/www.awayteam.co.uk/media/jui/css/chosen.css where I'm expecting http://www.awayteam.co.uk/joomla30/media/jui/css/chosen.css

I've tried reinstating the original .htaccess (as I kept a backup), but there's no change in behaviour. Is there a cache involved in the .htaccess rewrite process? I'm not aware of one.

Any ideas would be gratefully received.

Rob
Posted on 9 Feb 2014, 8:47 by Pietro Valocchi

Rob,

If you restored the previous files without recovering the expected behaviour, there is a cache issue: clear the cache (on both your local browser and the server).

Pietro
Posted on 9 Feb 2014, 9:51 by Rob Smith

Hi Pietro,

I've made a mistake. There's another problem with my website currently.

I'll let you know when I've resolved it, and then we can investigate Joomla issue #33071.

Thanks for your help so far.

Rob
Posted on 9 Feb 2014, 11:31 by Rob Smith

Ok. Not sure what the problem was, but I've reverted to an earlier version of my website which works as expected. I've also reverted to my original .htaccess file - copy attached. Pietro's suggested change is not present.

I notice that typing 'awayteam.co.uk' into the browser URL gives consistent behaviour from Joomla, but typing 'www.awayteam.co.uk' results in differing addresses between the logo and home links. I suspect there is a problem with my .htaccess.

I've tried tinkering with it, but every change I try seems to break something. Please could you take a look, Pietro? Thanks.

Rob
Posted on 9 Feb 2014, 12:24 by Pietro Valocchi

Rob,

the URL rewite is not working: if you write http://awayteam.co.uk/ in your browser, it is not redirected to http://www.awayteam.co.uk/

Try to add just

RewriteCond %{HTTP_HOST} ^awayteam.co.uk$

RewriteRule ^/?(.*)$ http://www.awayteam.co.uk/$1 [R=301,L]

 

before the trailing slash sections, deleting the last 3 parts of your .htacces.


Anyway, for sure there is something else not working properly, but it's difficult to say what.

You should try a more clean configuration/environment.

 


Pietro

 
Posted on 9 Feb 2014, 12:52 by Rob Smith

Hi Pietro,

Ok. I've changed the live site as you suggested - see attachment htaccess_clean_140209.

I think the rewrite is working now - many thanks. However, the home/logo button addresses still differ, which I believe was part of the original problem.

Please advise.

Rob
Posted on 26 Jul 2014, 11:36 by Brian Teeman

Is this still an issue or can we close this?
Posted on 22 Aug 2014, 5:41 by Brian Teeman

Thank you for your contribution and participation in the bug tracking process. As there has been no response to the request for further information I am closing this report at this time.

 

We have now moved our bug tracking process to http://issues.joomla.org/ so if you have further information that would enable this issue to be reopened please create a new report there.
Posted on 2 Feb 2015, 8:59 by Rob Smith

Apologies for my delayed coda. I overlooked your previous email.

I have just reactivated SEO on my site and all appears to be working correctly once again. In the interim, I have updated from Joomla 3.2.1 to 3.3.6, but cannot say more precisely when the issue was resolved.

Many thanks to Tobias and Pietro for all their help, and to whoever finally fixed this bug.

Rob