Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Issue with domain redirection


Go to End


2 Posts   1362 Views

Avatar
BenTucker

Community Member, 2 Posts

21 October 2015 at 6:42pm

Hi all,

I have multiple SS3.1 accounts on my web server and they've started doing something strange with their redirects. Images in the content of pages add main.php to the start of their links (eg. main.php/assets/folder/image.jpg). A look at the dev console shows SilverStripe is looking for the file at http://domain.com/framework/main.php/assets/folder/image.jpg and returns a 404 to that request.

A fresh install on a new account (on the same server) using 3.1.14 has the main domain redirecting to http://domain.comhttp//domain.com/install.php instead of http://domain.com/install.php as expected.

It seems there's an issue with the .htaccess file/s but I can't understand why they're behaving differently.

Unfortunately this isn't a straight forward case. The server was compromised on the weekend and we had to clear away all .htaccess files (and favicons) and re-upload. After that I also had to include Director::setBaseURL('/'); to the mysite/_config.php to get pages beyond the home page working properly (links to the .css was getting the main.php/ treatment) but this obviously doesn't fix the issue in all cases.

Does anyone know where I can look to try to solve this issue? The SS sites are the same as before, the server is the same as before, but obviously one or both aren't the same as before somewhere because the behaviour is broken/different. Myself and the server admin are stuck at this point.

i appreciate any and all ideas. Thanks.

Avatar
BenTucker

Community Member, 2 Posts

22 October 2015 at 12:52pm

Hi all,

Some server info that might help is below. I created a brand new account on the server, and used the 3.1.14 install from the SS archive (it's the closest match to what my other sites are running on). Getting a bad redirect out of the box with the correct .htaccess file uploaded.

One thing the server admin changed was adding ModSecurity to the server, which he said "may" give some false positives to SilverStripe requests. Could this have an affect on redirects? Does anyone have any ideas?

Does SilverStripe (the company) offer a paid service to help with tricky problems like this? We're pretty desperate for a solution and have almost run out of hair to pull out.

Apache Version 2.4.17
PHP Version 5.3.29
MySQL Version 5.5.45-cll
Architecture i686
Operating System linux
Kernel Version 2.6.32-604.30.3.lve1.3.63.el6.i686