17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1428 Views |
-
[SOLVED] Getting 404 in iFrame Fields

1 March 2008 at 2:05am Last edited: 1 March 2008 7:29am
Hello all
I'm experiencing strange problems after moving my SilverStripe Site from my local server to a Webserver.
The site works fine, however if i log into the Backend, i get a "Page not found" Page inside the Image Upload and other IFrames. The URLs that cause the Error are formed like this:
http://<www.mysite.com>/images/iframe/Person/22/PhotoI don't have the slightest idea what could cause this error. Please help me out.
Thanks -
Re: [SOLVED] Getting 404 in iFrame Fields

1 March 2008 at 7:29am Last edited: 1 March 2008 7:30am
I was able to solve the issue myself.
Somehow, the .htaccess File that comes with SilverStripe isn't compatible with all Apache Versions or doesn't work on all configurations.
This was running on a subdomain eg. http://sub.somedomain.com
Original rewrite rule:RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [ L ]
Which i replaced with
RewriteRule ^(.*)$ sapphire/main.php?url=$1 [ L,QSA ]
It does basically the same, i just rewrote it with my limited mod_rewrite Knowledge. $1 is the match from the rewrite Rule, the QSA flag keeps Query Strings and sends them to the rewrite "Target" as well. Maybe i should file a ticket for this...
After that, iFrame Fields were showing up nicely. The base href tag was broken on all these pages though (same goes for urls with action and parameter, eg. with multiple slashes)
I fixed this, by adding the following Line into my _config.php file (in my setup it was located in the mysite folder)Director::setBaseURL('http://sub.somedomain.com/');
Replace http://sub.somedomain.com with your domain
Hope that might help somebody.
| 1428 Views | ||
|
Page:
1
|
Go to Top |

