homepage Welcome to WebmasterWorld Guest from 54.205.98.35
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Browsers / Opera Browser Usage and Support
Forum Library, Charter, Moderator: open

Opera Browser Usage and Support Forum

    
mod_rewrites with Firefox, Opera & Safari
...work fine with IE
internetheaven




msg:1584857
 8:53 am on Sep 4, 2005 (gmt 0)

I use mod_rewrite on /folder/ for several php dynamic pages using:

RewriteRule products\/(.+)\.html$ /folder/products.php?productid=$1 [NC,L]

which works fine in all browsers, but I can't get them to go to the error page when someone tries to access a product that no longer exists. I've placed "ErrorDocument 404 /404.html" in .htaccess and even scripted the products.php file with:

$errorDocument404 = '/404.html';
if (!mysql_num_rows($res)) {
header("HTTP/1.0 404 Not Found");
include $errorDocument404;
exit;
}

but no matter what, even though both methods work fine in IE none of the three browsers Firefox, Opera & Safari will go to the error page. They all display blank pages except for Safari which outputs:

The page you opened redirected you to a page that isn’t supported by Safari. Safari can’t open the page “” because it cannot redirect to locations starting with “(null):”

I don't get what it means. Has anyone else come across this?

 

chriswragg




msg:1584858
 6:53 pm on Sep 4, 2005 (gmt 0)

The 404 Error Directive may be overiding the mod_rewrite in your htaccess. As the page does not exist and is being redirected by the mod_rewite, the 404 error may be returned by default. Try deleting this from your htaccess or moving it to after the mod_rewite rule.

encyclo




msg:1584859
 7:03 pm on Sep 4, 2005 (gmt 0)

One good test would be to install the "Live HTTP headers" extension for Firefox. If you try to access a deleted page with the extension's window open, you can record the headers sent between browser and server. This is a great tool for debugging problems such as this.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Browsers / Opera Browser Usage and Support
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved