Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect base meta tag for SSL websites #4961

Closed
GregoryRusakov opened this issue Oct 31, 2014 · 15 comments
Closed

Incorrect base meta tag for SSL websites #4961

GregoryRusakov opened this issue Oct 31, 2014 · 15 comments

Comments

@GregoryRusakov
Copy link

I've recently moved my website to SSL and found that Base meta tag is still "http" not "https".
But if I change this line:
$buffer .= $tab . '' . $lnEnd;

to this one:
$buffer .= $tab . '' . $lnEnd;

in file:
libraries/joomla/document/html/renderer/head.php

then everything works fine and Base meta tag is correct on all https pages.

@zero-24
Copy link
Contributor

zero-24 commented Oct 31, 2014

Hi @GregoryRusakov can you send a pull request against the staging branche?

If you need some help please see here: http://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests It is realy easy. If you have one we can discuss / test and merge the changes realy easy too.

Please add a message if you need more help or have a pull so we can close here and use the pull as place for discussion.

Thanks

@ghost
Copy link

ghost commented Nov 1, 2014

@GregoryRusakov
Could you please provide more detailed test instructions?
Why do you need $live_site setting at all?
Is Force SSL in Joomla configuration enabled?
Is Search Engine Friendly URLs enabled?

I think reason for the behaviour you see is in /libraries/cms/application/site.php line 159

if ($router->getMode() == JROUTER_MODE_SEF)
{
$document->setBase(htmlspecialchars(JUri::current()));
}

calling method current() in /libraries/joomla/uri/uri.php. But I don't know why there $live_site is ignored (compare with method base() line 218) and I don't know if it should be fixed or if it's the expected bahaviour and base() shouldn't be used there..

When I enable Force SSL I see always expected base tag; with or without $live_site set.

@GregoryRusakov
Copy link
Author

Could you please provide more detailed test instructions?
Then I enabled Force SSL (and Friendly URL also), I got a blank white page and disabled Force SSL option. So, I had to change $live_site to "https", but unfortunately the base tag hadn't changed. So, I had to change the head.php file and use Juri:: base() instead of $document->getBase(). This "Juri:: base ()" correctly set base tag and site works fine. (https://support.analitica.ru)

@ghost
Copy link

ghost commented Nov 2, 2014

"Then I enabled Force SSL (and Friendly URL also), I got a blank white page and disabled Force"
But that's not related to this issue. Sounds like a missconfiguration of your server or extension etc.

As I described above, we need a spacialist here, who knows if use of current() for the base tag is required here or if current() should be expanded to takeover the scheme set in $live_site.

@GregoryRusakov
Copy link
Author

"But that's not related to this issue." sure, it's not related with the issue. But it's just an answer to the question "Why do you need $live_site setting at all?".

By the way the problem was solved by replacing one line in head.php file...

@Hackwar
Copy link
Member

Hackwar commented Nov 14, 2014

Please answer the question why you set the $live_site variable and what the value of that variable was/is. In the end, if you have a http:// URL in $live_site, the behavior that you are seeing is actually expected. What should Joomla expect if you tell it its URL is a http:// one?

@brianteeman
Copy link
Contributor

As @Hackwar says please answer why you have @live_site set and why if you are now on https you didnt change it.

I have set this issue to 'Information Required' and it will be closed in a few weeks if there are no updates


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4961.

@superdeluc
Copy link

Very weird that this problem still exists. I also just hardcoded it in:

if (!empty($base))
{
$buffer .= $tab . '< base href="https://www.website.com/" />' . $lnEnd;
}
(without the spaces between < and base but otherwise it isn;t showing here)
Now everything is working fine. Force SSL put the site into a loop

@brianteeman
Copy link
Contributor

@superdeluxxx do you have a setting in live_site

@superdeluc
Copy link

In the configuration.php its set as

$live_site = 'https://www.domain.com';

if that is what you mean.
But that didn't kept the < base href="http://www.domain.com/" > from being shown without the httpS

@brianteeman
Copy link
Contributor

Please try without anything being set fr live_site. You shouldnt need it
On 2 Mar 2015 05:54, "superdeluxxx" notifications@github.com wrote:

In the configuration.php its set as

$live_site = 'https://www.domain.com';

if that is what you mean.
But that didn't kept the from being shown without the httpS


Reply to this email directly or view it on GitHub
#4961 (comment).

GregoryRusakov added a commit to GregoryRusakov/joomla-cms that referenced this issue Mar 3, 2015
Fixed https base tag generation.
Discussion is here:
joomla#4961 (comment)
@joomla-cms-bot
Copy link

Set to "closed" on behalf of @zero-24 by The JTracker Application at issues.joomla.org/joomla-cms/4961

@zero-24
Copy link
Contributor

zero-24 commented Mar 7, 2015

Clsoing as we have a Pull Requrst: #6270


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4961.

@joomla joomla deleted a comment Jul 20, 2022
@joomla joomla deleted a comment from nsplogin Jul 20, 2022
@joomla joomla deleted a comment from nsplogin Jul 20, 2022
@joomla joomla deleted a comment Jul 20, 2022
@joomla joomla deleted a comment Jul 20, 2022
@joomla joomla deleted a comment Jul 20, 2022
@joomla joomla deleted a comment Jul 20, 2022
@joomla joomla deleted a comment Jul 20, 2022
@joomla joomla deleted a comment from digitalindia02 Aug 25, 2022
@joomla joomla deleted a comment from digitalindia02 Aug 25, 2022
@joomla joomla deleted a comment from digitalindia02 Aug 25, 2022
@joomla joomla deleted a comment from digitalindia02 Aug 25, 2022
@brianteeman
Copy link
Contributor

@digitalindia02 are you really so stupid to think that this sort of spam will work

@Hackwar
Copy link
Member

Hackwar commented Aug 25, 2022

The user has been reported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants
@Hackwar @brianteeman @superdeluc @GregoryRusakov @zero-24 @jissues-bot @joomla-cms-bot and others