htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: 404 error not working for .php pages
PostPosted: 19 Jul 2007 12:24 
Offline

Joined: 19 Jul 2007 12:12
Posts: 1
Location: Newbury
Hi,

I haven’t had to get involved with htaccess previously so bear with me.

I’m trying to get all wrongly addressed pages to revert to the ‘index’ page.
The 404 error redirect works fine if the page requested is .htm or .html but not if it is addressed .php? All of the site’s pages are .php.

My htaccess file looks like this…


ErrorDocument 404 http://www.serversys.com/index.php

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^$ [OR]
RewriteCond %{HTTP_HOST} ^www.$
RewriteRule ^(.*)$ http://www.serversys.com/ [R=301,L]

AddHandler php5-script .php
AddHandler php4-script .php4
AddHandler php5-script .php5


Can anyone help please?

Jim


Top
 Profile  
 
 Post subject: Re: 404 error not working for .php pages
PostPosted: 20 Aug 2007 15:04 
Offline

Joined: 28 Feb 2007 17:16
Posts: 41
jm60 wrote:
Hi,

I haven’t had to get involved with htaccess previously so bear with me.

I’m trying to get all wrongly addressed pages to revert to the ‘index’ page.
The 404 error redirect works fine if the page requested is .htm or .html but not if it is addressed .php? All of the site’s pages are .php.

My htaccess file looks like this…


ErrorDocument 404 http://www.serversys.com/index.php

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^$ [OR]
RewriteCond %{HTTP_HOST} ^www.$
RewriteRule ^(.*)$ http://www.serversys.com/ [R=301,L]

AddHandler php5-script .php
AddHandler php4-script .php4
AddHandler php5-script .php5


Can anyone help please?

Jim



Code:
ErrorDocument 404 http://www.serversys.com/index.php

Options +FollowSymLinks

AddHandler php5-script .php
AddHandler php4-script .php4
AddHandler php5-script .php5

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^$ [OR]
RewriteCond %{HTTP_HOST} ^www.$
RewriteRule ^(.*)$ http://www.serversys.com/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB