When I export my DB from one environment to another, all links created with {structure:page_url_for:{entry_id}} format try to load the environment URL path from the database I imported from another environment.

If I to go to Admin -> General Configuration, the URLs and Paths look right (assuming from Focus Lab config setup) and if I just re-save that page, structure links start working again.

  • BTW I'm using EE 2.8 and latest Structure 3.3.14 – jthomas Mar 16 '14 at 1:44
  • I went to Admin -> General Configuration and re-saved that form. All the right URLs and Paths were in there. I'm guessing when I pushed my database up from my local environment, these values got reset in the database, but looked like they were correct on the frontend due to the master config file. – jthomas Mar 16 '14 at 21:40
  • I've been able to isolate it to links created with structure tags, like this: {structure:page_url_for:{entry_id}}. Links created with {path=.../...} work fine. – jthomas Mar 17 '14 at 21:39

I've actually run into this issue on a couple of MSM sites in the last couple of weeks.

From what I can gather, at some point the root URL is stored in the 'site_pages' column in the 'exp_sites' table, for each site.

I have a PHP script that decodes/encodes and unserialzies/serializes the data, and tells you what to change. Ping me at @degerstrom or pal@felt.no if you need more details.


The issue will be done to the config.php file or the database. The config file will always overwrite the database, so irrelevant of the General Configuration settings within the Control Panel. Also I expect the path in question is set within the template settings, not general config.

Because you're using Master Config chances are you've not set the correct environment variable or path, so it's incorrectly identifying the pathing based on the server - or the staging server hasn't been set up correctly.

Highly recommend using the Deeploy Helper add-on, which will identify any stray paths anywhere in your build - be it config file or database.

  • I think you're right, I just cannot identify where this might be getting set incorrectly. Again, today, I exported my staging DB and imported it to my local DB and my CP View Page links are now pointing to my Staging DB. Only after I go to Admin -> General Config and save the settings displayed there does it begin to work again. – jthomas Mar 16 '14 at 21:41

The links in Structure will actually not be affected by any configuration settings. I don't think this is specific to Structure, but I might be wrong.

In any case, give this a try: https://gist.github.com/degerstrom/9591099

  • Thanks, I'll take a look at this. I noticed it was also happening when clicking on search result links. Basically anywhere I've used href="/some/url" gets prefixed with the wrong environment url. – jthomas Mar 16 '14 at 23:30
  • Maybe I should be using {path="..."}? – jthomas Mar 16 '14 at 23:30

It appears there is a bug report for this on expressionengine.com. The team is aware of it.


Additionally, the support team for Structure has provided me with some beta code to test a way to get around this and it worked. The next version of Structure should be out soon and does not use incorrect environment urls, regardless of the EE bug I linked to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.