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

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Restful redirect gives 404 in IE only
newbies




msg:4668262
 5:40 pm on May 3, 2014 (gmt 0)

Hi all

I have a php program which has used mod rewrite to remove index.php in url. It works in all browsers except Supid IE. IE would load the page for less than a second then it redirect to a 404 page. This occurs in all IE versions. If I turn off Display friendly error message, it works fine. below is my htaccess file.

Thank you for help.

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^bladd(.*)$ /index.php/bladd$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php/index/$1 [QSA,L]

 

lucy24




msg:4668269
 7:10 pm on May 3, 2014 (gmt 0)

I don't see the redirect. You're only showing the back half: where you rewrite the new request to serve content from index.php. What does the redirect itself look like?

If I turn off Display friendly error message, it works fine.

Turn it off where? Is this a setting in your personal browser, or is there a CMS involved?

Does MSIE still do that annoying thing where if a custom error message is too short, they show a generic default instead? Don't see how this could apply to redirects, though.

newbies




msg:4668345
 12:11 pm on May 4, 2014 (gmt 0)

>>Turn it off where? Is this a setting in your personal browser, or is there a CMS involved?

the setting is in under advanced tab in IE.

aristotle




msg:4668379
 3:56 pm on May 4, 2014 (gmt 0)

Are you talking about the setting called "disable script debugging"?

That's supposed to only be used for testing code. For general browsing, it's supposed to be turned off.

tangor




msg:4668383
 4:10 pm on May 4, 2014 (gmt 0)

Info note on IE, not an answer to the question above (though it might be...)

If the disable script function keeps activating, do not do it in IE itself. Close IE then use the Start/Control Panel/Internet Options and do it from there. Close that down then start IE again. Sometimes IE will not keep a setting while it is running.

not2easy




msg:4668387
 4:31 pm on May 4, 2014 (gmt 0)

It sounds more like one of the Advanced Options in IE Settings: "Display friendly error messages". If the Rewrite is returning a 500 error for example and no custom error page exists, it could give you a 404.

lucy24




msg:4668442
 8:03 pm on May 4, 2014 (gmt 0)

Oh, ###, didn't think of that. We need to separate two things: what's happening in the server, and what MSIE says is happening.

Two sources of information:
-- server logs. Does the request return a 301? If the redirect happens in-page or in a php script, as implied by the OP, logs will be useless because they will always show a 200. But check them first.
-- a tool such as Live Headers in Firefox. This will show you what numerical response is returned to the browser, regardless of how it was initially generated.

Before you can deal with MSIE, you need to know what the underlying events are.

newbies




msg:4668497
 3:27 am on May 5, 2014 (gmt 0)

my .htaccess mod_rewrite rule works in FF and Chroma, but not in IE. IE briefly display the page for less than one second, and then it autumatically redirects the page to a 404 page. If I turn off "Display friendly error messages" in IE, it works fine.

the problem is about 10% visitors still use IE, they are unable to visit my site.

lucy24




msg:4668524
 8:31 am on May 5, 2014 (gmt 0)

If I turn off "Display friendly error messages" in IE, it works fine.

How can something you set in your own browser affect what is seen by external visitors to the site?

it automatically redirects the page to a 404 page

Careful. You're going to have to be very precise here. Do you mean that it redirects-- that is, the URL in the browser's address bar changes again-- or do you mean that the screen shows the content of a 404 page?

newbies




msg:4668562
 10:45 am on May 5, 2014 (gmt 0)

How can something you set in your own browser affect what is seen by external visitors to the site?

I mean it works in my own IE browser after changing the setting.

I PMed you with example URL.

newbies




msg:4668700
 11:25 pm on May 5, 2014 (gmt 0)

Hi guys,

It turns out that a link in a linked css is broken, and IE immediately redirect the page to 404. Why cannot stupid IE just silently ignore the broken link as do FF and Chroma?

Thank you all for trying to help.

tangor




msg:4668726
 1:21 am on May 6, 2014 (gmt 0)

What part of the css caused that behavior in IE? That's something the rest of us would like to be aware of!

lucy24




msg:4668727
 1:29 am on May 6, 2014 (gmt 0)

Edit: Overlapped Citrus Hybrid again, but fortunately we're asking the same question.

Whoa there. For future reference I want to be sure I understand this.

The page itself is fine, but it links to an external stylesheet that doesn't exist. When this happens, MSIE displays the 404 page even though only the stylesheet, not the page itself doesn't exist. (Or is it the external stylesheet that in its turn links to something that doesn't exist, so we're now TWO steps away from the original page?)

Have I got that right? Does the same thing happen with any other type of linked content, such as images? All versions of MSIE, or only some?

:: tottering off to apply cold compresses to forehead ::

newbies




msg:4668730
 2:53 am on May 6, 2014 (gmt 0)

The page itself is fine, but it links to an external stylesheet that doesn't exist. When this happens, MSIE displays the 404 page even though only the stylesheet, not the page itself doesn't exist. (Or is it the external stylesheet that in its turn links to something that doesn't exist, so we're now TWO steps away from the original page?)

Yes, the broken link is a linked CSS file, two steps away. This only occurs to IE older than 10.

The symptom is IE load the page without a problem, but within a blink of an eye, it gives a 404 page. I first thought this has to do with the rules in htaccess, then someone asked me to examine my 404 error logs. That is how this problem has been solved.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
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