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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

SS Rewriting URLs? SlideshowPro problem ...


Go to End


5 Posts   1534 Views

Avatar
Valorinbattle

Community Member, 95 Posts

5 February 2010 at 5:36pm

I am using SlideshowPro on my homepage for a flash slideshow banner. Following the instructions I found in here, I was able to get it functioning perfectly except this:

In the component inspector, I set the default path as http://mysite.com/home/xml
So if I browse to http://mysite.com the slideshow loads perfectly.
But if I browse to http://www.mysite.com the slideshow never loads because the default path is listed without the WWW.

So, how can I set the default path to include and not include the WWW?

I tried to go into my hosting account and just create a redirect so that if anyone went to http://www.mysite.com it would redirect to http://mysite.com, but it won't take. My host (A2Hosting) says that it seems SS is rewriting my URLs. I don't think that makes any sense, but am not sure what else to do. Any ideas?

Thanks for your help everyone.
~ James

Avatar
Solo

Community Member, 32 Posts

5 February 2010 at 6:11pm

Edit .htaccess file, and put there:
RewriteCond %{HTTP_HOST} ^www.yoursite.com
RewriteRule (.*) http://yoursite.com/$1 [R=301,L]

Avatar
Valorinbattle

Community Member, 95 Posts

5 February 2010 at 6:42pm

Solo, that was awesome! Thank you. It makes the very first page on the re-direct non-friendly, but after that all's good. This was a very simple solution. Kudos to you.

Avatar
bummzack

Community Member, 904 Posts

5 February 2010 at 7:44pm

The slideshow actually never loads because of Flashs security Model. If you want to fix this (and don't want to rely on the rewrite or rather prefer the www in your url) then do the following:
Create a file named crossdomain.xml with the follwing contents:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
	    <allow-access-from domain="www.mysite.com" />
	    <allow-access-from domain="mysite.com" />
</cross-domain-policy> 

Upload it to your web-root. Done.
If you have other domain-names pointing to the same content (aliases), add them to the list of allowed domains as well.

Avatar
Valorinbattle

Community Member, 95 Posts

5 February 2010 at 7:46pm

Thanks Banal. I'll give that a shot tomorrow!