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.

General Questions /

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

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

SS Rewriting URLs? SlideshowPro problem ...


Reply


5 Posts   1135 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
banal

Community Member, 901 Posts

5 February 2010 at 7:44pm

The slideshow actually never loads because of [url=http://kb2.adobe.com/cps/142/tn_14213.html]Flashs security Model[/url]. 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!