1

I have a site that uses SEF URLs and htaccess RewriteRules to serve up the pages. This has worked fine for several years until the arrival of IE9.

Now it appears that the links are not being rewritten and the site is dead in the water.

I have tried different compatabilty modes, to no avail, and I've played with the Rewrite Rules over and over, tried different doctypes and a few other browser settings. I agree that it cannot in theory be a browser specific problem if the problem is with the htaccess file but this site works in IE8, firefox and chrome. I have run the rewriterule through a validator and it looks fine. Any ideas would be appreciated as I am running out of ideas.

The site is www.marlboroughsounds.co.nz a sample link is

http://www.marlboroughsounds.co.nz/walking/freedom-walk-queen-charlotte-track/4dfw

and the rewrite rule thats not working looks like this:

RewriteRule ^walking/.*/([a-z0-9_]*)/?$ /walking.php?act_code=$1 [L]

The link fails and it serves up a browser 404 page, not even the custom 404 I have for the site.

Any ideas would be much appreciated as I am stumped.

mouli
  • 21
  • 3
  • Loading fine here in IE 9 (and Chrome), no 404. Are the 404s registering in the Apache access log? – Shane Madden Nov 19 '11 at 03:30
  • Many thanks for checking it out and it raises an interesting point. Following your comment I tried the link and it worked too but if I click on any of the links in the top nav bar I get 404s. I'm going to try stripping everything out of a page leaving only the link to see if any on page factors are causing IE to fail. The error log show entries such as: [Sat Nov 19 02:56:24 2011] [error] [client 176.9.51.136] File does not exist: /home/msac/public_html/seakayaking/1-day-guided-kayaking-queen-charlotte-sound/1dgk-qcs I have the access logs but I haven't burrowed into them for errors yet. – mouli Nov 19 '11 at 09:03

2 Answers2

1

As a few folk pointed out, the page itself could not effect how the htaccess file did its work so I focused on the page itself and after a long series of elimination tests found that the include that I had at the top of the page to enable Wordpress plugins to function on this page was causing some sort of conflict in IE9 which was causing the links to break.

I think the include included some of the Wordpress URL processing actions which caused the problem. When I only loaded the portion of the include needed to run the plugins it worked!!!

user9517
  • 114,104
  • 20
  • 206
  • 289
mouli
  • 21
  • 3
0

The browser is not responsible for rewriting the content. Your access logs should contain the requests so that you can see what is being requested. Also check your error log to see if there are any errors.

If the request is not arriving at your server, then I would using a logging proxy on the client end to see what is being requested. Looking at the page source received by the broser can be helpful in determining why the page is not working as expected.

If use Javascript on the browser to build links it might not be working correctly. Look at the access logs to see what is arriving.

Adding a Rewritelog directive with generate a log of rewrites which may be helpful for diagnosing the problem. Comment out or remove the directive when you are done.

BillThor
  • 27,354
  • 3
  • 35
  • 69
  • Some interesting ideas here so many thanks. Browser requests to a random url look like this: GET /walking/a HTTP/1.1 Accept: text/html, application/xhtml+xml, */* Accept-Language: en-NZ and I'll try the rewritelog directive too. User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; MATP) Accept-Encoding: gzip, deflate Host: 121.72.242.153 Connection: Keep-Alive – mouli Nov 19 '11 at 09:06