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.

Installing SilverStripe

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

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

Friendly URLs No Longer Working - After Domain Change - (SS 3.0)

Go to End

13 Posts   1840 Views


4 August 2013 at 11:15pm Community Member, 37 Posts


I had been developing an SS 3.0 site on a remote server using the domain '' pointed to a folder called 'webroot'. All working perfectly.

Then, I asked the web-host to delete the subdomain ( and now point '' to the 'webroot' folder ready to go live.

After that change friendly urls stopped working. The symptom is this: Home page is ok, loads in and reads as url However! any link or navigation now has this symptom:

Anyone know the solution?

This is the current .htaccess file

<Files *.ss>
   Order deny,allow
   Deny from all
   Allow from

<Files web.config>
   Order deny,allow
   Deny from all

# This denies access to all yml files, since developers might include sensitive
# information in them. See the docs for work-arounds to serve some yaml files
<Files *.yml>
   Order allow,deny
   Deny from all

ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html

<IfModule mod_alias.c>
   RedirectMatch 403 /silverstripe-cache(/|$)
   RedirectMatch 403 /vendor(/|$)
   RedirectMatch 403 /composer\.(json|lock)

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase '/'

   RewriteCond %{REQUEST_URI} ^(.*)$
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_URI} !\.php$
   RewriteRule .* framework/main.php?url=%1&%{QUERY_STRING} [L]

Many thanks!


5 August 2013 at 10:55am Forum Moderator, 921 Posts

One thing could be the RewriteBase, but if the site is in the same place but domain changed that shouldn't have affected rewriting.

Perhaps something to check in with the host to see what's going on with the rewrite?


5 August 2013 at 8:56pm Forum Moderator, 1091 Posts

Also I think 'webroot' should never appear as a directory in the url regardless. Are you sure the domain isn't now for some reason pointing to the directory above?

Curious: what happens when you remove index.php from the url by hand - does the correct page display?


5 August 2013 at 9:27pm (Last edited: 5 August 2013 9:28pm), Community Member, 37 Posts

Thanks for the suggestions guys!

Martimiz, interesting I remove 'by hand': webroot/index.php, leaving this: And it works, the correct page renders. Except in the case of a silver-stripe shop page which reverts to: ''

I'm not much of an Apache/Webserver/Routing expert so not sure what to make of these symptoms, other than it seems a bit weird : )


6 August 2013 at 8:40am Forum Moderator, 1091 Posts

One more question, just to be sure, dit you try flushing (or even emtying) your silverstripe cache after the domain change? (just to rule that out)


6 August 2013 at 9:47pm Community Member, 37 Posts

Yes, there have been a number of dev/build and flush since the change of domain. I've also just created a silverstripe-cache in webroot and cleared that, the same problem persists.


6 August 2013 at 10:29pm (Last edited: 6 August 2013 10:32pm), Forum Moderator, 1091 Posts

By the way (forgot to ask this in the first place): does actually display the correct page?

Other possible questions (I'm in the blind here):

- Does your hosting provider allow access to a control panel where you can see the actual webroot for your domain?
- Can you print out the value of Director::baseURL()
- For the 'fun' of it - what happens if you set RewriteBase /webroot in .htaccess?

Oh, and you're not on GoDaddy?


6 August 2013 at 11:36pm Community Member, 37 Posts

Thanks again martimiz for more suggestions : )

Yes, all of those webroot/index.php links are rendering the correct pages it seems.

- Its not my hosting server unfortunately, so not sure who the host is exactly but there is a cpanel, and I have WinSCP access to the root file structure, also the site was working perfectly ok prior to the domain switch (on same server).

- Not sure how to print the value of 'Director::baseURL()'? Is there a way to do that with the debugging tools included in SS?

- I did try that RewriteBase change in .htaccess as it happens, while exploring, and it made no difference.

Go to Top