Recent Topics

Tried to change base URL, made things worse

Started by on Nov 26, 2018 – Contents updated: Nov 27, 2018

Nov 26, 2018 18:05    

Ok so when I first set up my site, I for some reason set the "base URL" to be mydomain.com without the www. at the beginning. I now feel I want to change this.

I was surprised to find no setting for this in the UI. Especially not in the expected "URLs" section (although that's only under Collection, not site-wide). Only reference I could find was within _basic_config.php so I tried editing it there.

Well, that broke everything. So I changed it back. Now pages load again, but I'm getting several lines of the following at the top of every page:

Warning: Cannot modify header information - headers already sent by (output started at /xxx/xxx/xxx/xxx/conf/_basic_config.php:1) in /xxx/xxx/xxx/xxx/inc/_core/_template.funcs.php on line 338

Eeek. Ok:

1) How can I fix the immediate issue? I already tried clearing all the caches.
2) What's the proper way to accomplish changing the base URL as I desire without breaking everything?

Nov 26, 2018 19:25

@amoun wrote earlier:

Have you read
https://b2evolution.net/man/base-url


Yes. That's one of the places I found mention of _basic_config.php. But it also doesn't mention how to address my specific situation or how to fix what has broken as the result of trying to change it in the mentioned _basic_config.php :(

Nov 26, 2018 21:41

First of all it would be useful to know

1) What version you have the problem with. Have you updated since your last 6.9.3 https://forums.b2evolution.net/index-php-issue-on-new-install

2) A screenshot of the the first instance of where you get the error, which should include the address bar with full url. If you provide your website url 'we' can look at it and get a better understanding of what you see

@sremick

1) How can I fix the immediate issue? I already tried clearing all the caches.

Have you tried logging out and using another browser?

Nov 26, 2018 22:08

@amoun wrote earlier:

1) What version you have the problem with.


b2evolution 6.10.4-stable

A screenshot of the the first instance of where you get the error, which should include the address bar with full url. If you provide your website url 'we' can look at it and get a better understanding of what you see

I can PM you the URL if you'd like (would rather not post it here), but the error is exactly worded as I mentioned previously, repeated 5 times with the following "line" numbers: 40, 336, 337, 338 and 339. It appears at the very top of the page before any header or other page content.

Have you tried logging out and using another browser?


I have tried another browser and it gives the errors too. I just tried logging out and now I can't log back in:

Incorrect crumb received! [loginsalt]
Your request was stopped for security reasons.
Have you waited more than 120 minutes before submitting your request?
Please go back to the previous page and refresh it before submitting the form again.
Alternatively, you can try to resubmit your request with a refreshed crumb:

Nov 26, 2018 22:39

Warning: Cannot modify header information - headers already sent by (output started at /xxx/xxx/xxx/xxx/conf/_basic_config.php:1)

You added junk to your basic config file when you edited it. Restore a backup or clean it up. Save it as Latin 1 instea dof UTF-8 if that's an option of your text editor.

I was surprised to find no setting for this in the UI.

You can actually change it from the UI by using absolute URL here: https://b2evolution.net/man/collection-base-url-settings

That is not recommended though. In many situations, having everything relative to a baseurl allows to run the same site on a production server and on a development machine. DB backups will immediately works on the dev machine because only the conf file needs to be different.

Well, that broke everything.

No screenshot, no error message. Cannot help.
It should work unless you have an htaccess file that makes competing redirects.

Nov 27, 2018 05:09

Found the typo! A single stray keystroke had somehow wormed its way elsewhere into the file.

After that, I was able to make all the aesthetic changes I wanted to the URLs without issue.

Thanks for your help and patience, everyone.


Form is loading...

Multiblog engine – This forum is powered by b2evolution CMS, a complete engine for your website.