News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Change Board Url in Settings.php

Started by Dreemman, May 30, 2022, 06:15:02 AM

Previous topic - Next topic

Dreemman

New Installation on CyberPanel tends not to work well with WWW heading ... Can the board_url be changed in Settings.php file ??

Arantor

There's several places that need changing. Please see: What is repair_settings.php?
Holder of controversial views, all of which my own.


Dreemman

Quote from: Arantor on May 30, 2022, 06:17:09 AMThere's several places that need changing. Please see: What is repair_settings.php?

How complicated would changing urls manually be ?? Sometimes it's preferred to do things the hard way ...

1. Change urls in Settings.php
2. Change urls for themes
3. Change urls for avatars
4. Change urls for cookies

Arantor

Well, you could go into the database to change those, or you could use the tool I mentioned to do it for you?
Holder of controversial views, all of which my own.


Steve

Arantor's suggestion is best. Not that he needs me to confirm that because he doesn't.
My pet rock is not feeling well. I think it's stoned.

Doug Heffernan

Quote from: Dreemman on May 30, 2022, 06:28:12 AMHow complicated would changing urls manually be ?? Sometimes it's preferred to do things the hard way ...

1. Change urls in Settings.php
2. Change urls for themes
3. Change urls for avatars
4. Change urls for cookies

May I ask why you want to change them manually when the the aforementioned tool will do that automatically for you? Anyways, if you are going to change/modify the database, do not forget to make a backup of it first, for just in case.

Dreemman

Quote from: Doug Heffernan on May 30, 2022, 07:11:32 AMMay I ask why you want to change them manually when the the aforementioned tool will do that automatically for you? Anyways, if you are going to change/modify the database, do not forget to make a backup of it first, for just in case.


Doing things automatically will not allow me to know exactly what is wrong ... Say now, with WWW heading, i cannot load images in x.template.php files, images are always blank, i would need to open fourth or fifth tab to load the images ... Somehow something is preventing images from displaying ... Fixing this issue by directly removing WWW heading with the repair.php file might not give me any insight on this issue ...

Dreemman

Quote from: Arantor on May 30, 2022, 06:41:34 AMWell, you could go into the database to change those, or you could use the tool I mentioned to do it for you?

The board is absolutely fresh, 4 days old ... I need to settle this issue ... Though i strongly believe the issue is from CyberPanel ... Just trying to work things out not skip ...

Arantor

Well, the reapir_settings.PHP just shows you all the settings at once that are relevant to the board URL and let's you change them all in one place, as the help page about it tells you.

I guarantee you won't magically learn anything useful to debugging the issue you have from doing it manually.

What would help, if you'd like help debugging it, is to explain what problem you have with examples.
Holder of controversial views, all of which my own.


Dreemman

When i have any of these
1. <img src="', $boardurl, '/images/testimage.png" />

2. <img src="/images/testimage.png" />

3. <img src="www.sitename.com/images/testimage.png" />

... in a template file, it will show blank, except i reload that same page a few times by opening new tabs ... This issue is only seen when address header has WWW ... I've recreated sites a lot since last week but issue still persists ...

When i install a site without WWW header (i.e step 4 of smf installation), everything works well ...

Dreemman

As long as WWW is in address header, images won't show .... The page has to be reloaded a few times ... Attachments work well, but avatars are also affected ... Avatars on boardindex won't naturally show except i reload the page ...

Arantor

Link to site to see this in action?

Also note your last example doesn't work because it needs to have http:// or https:// at the start otherwise the server will look for a folder of that name instead.
Holder of controversial views, all of which my own.


Kindred

1- pick which you plan to use, www or non-www

2- use repair_settings.php to set all urls to that

3- set up htaccess to force all connections to the correct url www/non-www and http/https.

4- activate the image proxy if you are still having problems with external urls that use http instead of https.



There is no need to alter any templates, and I guarantee,  if you do, you'll probably screw something up that is dependent on the original code.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Oldiesmann

As far as step 3 goes, there's probably a setting somewhere in cPanel to do that for you automatically, but I haven't used cPanel in years so I don't know what they do anymore (I switched to Plesk years ago to get away from CentOS)
Michael Eshom
Christian Metal Fans

Dreemman

After spending hours looking, i've found the source of the issue as a result of using about 9 browsers including a very old mobile browser ... The issue is based on the img tag and the lazy loading attribute    ...

Somehow lazy loading images in divs (with complicated class features) prevents images to not load smoothly, and this only happens in browsers released not more than two months ...

And for test sites without WWW, css file is slightly altered and not fully loaded, this idea allows for images to show there ... I removed the html code in x.template files and tweaked the css, then i got the same issue of images not showing ...

Now it's to go into the major css file and find what conflicts with lazy loading ...

I' ll probably recreate sites a  few hundred times by the end of tomorrow ...


Sorry for the alarm, this was just a terrible design issue ... As though sites before these sites didn't show this error, and i assumed otherwise ...

Kindred

Or, instead,  you can fix the issues by following my instructions above and not modify any css or templates......
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Oh, he's made *other* changes on top of that which have broken it - changes not originally explained (like how SMF doesn't exactly do lazy loading by default) but didn't want to talk about for whatever reason.
Holder of controversial views, all of which my own.


Advertisement: