Strange problems with Pretty URLs

Permalink
Hi Folks,

I've run into a strange problem with a site. I have migrated to a new host and the steps that I took were to install a clean version of C5, upload all associated packages, upload the theme, upload the files folder and then to synchronise the db with the original db on the old host. After some faffing about with some missing blocks and cache, I got the site working however, everytime I logged in and then switched between viewing the site and going to the dashboard, I'm logged out and have to log back in again.

I have narrowed the problem down to Pretty URLs being either turned on or turned off. When turned off, all seems to be fine and I can navigate between the site and dashboard, edit pages and blocks etc but as soon as I turn them back on, the problem reoccurs.

I've cleared the cache both through the dash and via FTP (manually emptying the cache folder) but can't get past this. I've deleted the original htaccess file which then forces C5 to recreate it but that doesn't help. With Pretty URLs turned on I can get to pages once logged into the dash but the edit bar disappears as soon as I click the edit button and the page refreshes.

The site is a straight copy of the original running 5.6.3.4 and is athttp://www.lochtayhighlandlodges.co.uk/... (there is also a problem with the Gallery page but I'll tackle that once I get this sorted out!).

I don't want to leave Pretty URLs turned off as the site works well in Google and all results are pointing to the Pretty URL version.

Just wondering if anyone else has had a simliar problem (I've seen some posts on here, most very old, but not showing this exact behaviour). I'm rapidly running out of hair to pull out!

Many thanks in advance.

Cheers,

Duncan

ppisoban
 
ppisoban replied on at Permalink Reply
ppisoban
Still struggling here....... anyone?
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Your method of moving servers is not the way I do it..
First from the old site, clear the cache and turn off pretty urls.
Next make a zip file of the entire site including all folders and files.
Export your existing database as a sql dump.

Next on the new server, make a new database file and import the sql dump.
Upload your zipped file into the site root and extract it there, you will find the extracted files will be in a folder, just move the contents of that folder into the root.

Edit your site.php file to reflect the new database user and database name etc.
Hopefully if all went well you can sign into your site and enable pretty urls and clear the cache..

It may take a little while for the new dns settings to propagate globally but should all settle down within 24 hours.
ppisoban replied on at Permalink Reply
ppisoban
Hi Weyboat,

Many thanks for your reply.

I think, with the exception of zipping up the site files, the end result is the same. I simply downloaded all of the site files via FTP and then uploaded the relevant folders (files, themes, packages etc). Then uploaded the database and connected the site to the new db.

I transerred the site about 48 hours ago and so propagation shouldn't be an issue now.

I have a feeling that this has something to do with the way that the new host caches. I say that because I've also seen some strange things happening when I manage to edit a page. I can't see the edit unless I force a refresh with Ctrl/F5. I've asked the question of their tech support and I'm waiting for an answer at the moment. I'm no expert with PHP but I hope that I can do something with a php.ini file that might help.

In the meantime, I'm setting the site up under a dev domain and tinkering there to see if I can fix the problem! The public side of the live site is functioning fine so at least the client is (relatively) happy for the moment.

I like a challenge but this is driving me up the wall!

Cheers,

Duncan
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Okay
One more thing to check, see if your server is running varnish caching in the background as this can have some strange effects..
ppisoban replied on at Permalink Reply
ppisoban
From phpinfo:
_SERVER["HTTP_X_VARNISH"] 944714590

Is this what you mean? It's the only mention if 'varnish' in phpinfo. It's a new one on me, what does it do?
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Yep thats it!
You should be able to turn it off in control panel, or ask your server admin to do that for you..
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
If you have access to control panel, its in the 'Software' section.
ppisoban replied on at Permalink Reply
ppisoban
Thanks for that! At least I feel like I'm heading in a direction now, hopefully the right one!

Tech Support came back and mentioned Varnish too but unfortunately they don't give me the option to turn it off myself. I'm on shared hosting and I can't see it in cPanel so I've just asked the question as to whether I'm going to have to ask them each time I set up a c5 site. I'm currently migrating all my sites to them so if I do, that's going to be a real pain!!

Thanks a lot for the pointer, hopefully it'll save what's left of my hair. I'll try and update this if/when I get the site running properly.
ppisoban replied on at Permalink Reply
ppisoban
Support got back to me and told me that they had disabled Varnish but this still hasn't solved the problem.

The really strange thing is that I tried setting up a clean install on an unused domain and this seems to work fine. I can login, edit and create pages whether Pretty URLs are on or off, indeed whether htaccess even exists or not! This suggests to me that there must be something in either the db or the theme files that is not liking a path to a file, or something like that. I've checked both header and footer files and everything checks out and all paths are written using the proper syntax (<?php echo $this->getThemePath()?>) and all files exist.

Back to the drawing board.................