21303 Posts in 5736 Topics by 2603 members
General Questions
SilverStripe Forums » General Questions » SOLVED: Problem with 404 Error Page for .php file extensions
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 2167 Views |
-
SOLVED: Problem with 404 Error Page for .php file extensions

4 November 2009 at 4:56am Last edited: 4 November 2009 5:28am
Hi all,
Wonder if you can help me?
Got an email from client this morning. The 404 Error page is giving some strange results.
There are still some links on google to their old site which do not display the SS 404 Error page as expected, eg:
http://www.globalconnects.com/translation-home.php
However, if you were to try something else, such as
http://www.globalconnects.com/translation-home
or
http://www.globalconnects.com/translation-home.html
that works fine!
But as soon as you add in the .php extension it goes back to what appears to be the server-side error pages.
I am sure there is a good reason for this, but I don't know what it is!
I've logged into the server control panel and tried setting "Custom Error Docs" to both on and off, but that made no difference.
Any help appreciated.
Thanks,
Linsey
-
Re: SOLVED: Problem with 404 Error Page for .php file extensions

4 November 2009 at 5:12am
Hi Linsey
The reason for this is that Silverstripe uses php files itself, so it cannot handle urls ending in .php within it's own cms 404 page system.
What you can do is add a line to the end of your .htaccess file like this:
ErrorDocument 404 /page-not-foundThis tells the server to redirect 404's that Silverstripe doesn't handle back to a specific page. The url I have set it to there is the default url for the "Page Not Found" page in SS. You should double check in the cms that your SS 404 page has the same url. If not, change accordingly.
Ronan
-
Re: SOLVED: Problem with 404 Error Page for .php file extensions

4 November 2009 at 5:23am
Hey Ronan,
Thanks for the speedy reply... appreciated.
I kinda thought it was something along those lines, but I was stumped as to what to do about it!
So, just to clairfy... I should put the following line of code:
ErrorDocument 404 /page-not-found
exactly as it appreas above, into the .htaccess file in the site root?
Cheers!
Linsey
-
Re: SOLVED: Problem with 404 Error Page for .php file extensions

4 November 2009 at 5:23am
p.s. yes, that is what the 404 page is called.
-
Re: SOLVED: Problem with 404 Error Page for .php file extensions

4 November 2009 at 5:27am
works like a charm, thanks.
| 2167 Views | ||
|
Page:
1
|
Go to Top |


