2 Replies - 772 Views - Last Post: 22 September 2010 - 01:04 PM

#1 No0Vad  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 35
  • Joined: 18-February 10

RewriteRules doesn't work under certain conditions

Posted 22 September 2010 - 12:31 PM

I've noticed that the following rule doesn't work.
RewriteRule ^article/([0-9]+)$ article.php?id=$1


However, if I rename the file to article2.php (and change it in the rule) it works. Or if I change article (on the left)
to article2 it also works.

Without any RewriteRules it still works to visit site.com/article/3 or site.com/article.php/3

What is causing it? Is there a way to fix it?


I'm running Apache/2.2.15 and PHP v5.3.2 under Windows 7

This post has been edited by No0Vad: 22 September 2010 - 12:31 PM


Is This A Good Question/Topic? 0
  • +

Replies To: RewriteRules doesn't work under certain conditions

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3712
  • View blog
  • Posts: 5,964
  • Joined: 08-June 10

Re: RewriteRules doesn't work under certain conditions

Posted 22 September 2010 - 12:46 PM

I just tested this on almost an identical setup (Apache 2.2.14, PHP5.3.1, Win7) and it seems to work fine.

Quote

Without any RewriteRules it still works to visit site.com/article/3 or site.com/article.php/3

The URL is rewritten without any RewriteRules? That can't be. There must be a rewrite rule somewhere. In the main config, perhaps? Or in a parent directory?
Was This Post Helpful? 0
  • +
  • -

#3 No0Vad  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 35
  • Joined: 18-February 10

Re: RewriteRules doesn't work under certain conditions

Posted 22 September 2010 - 01:04 PM

I've checked the server config and there are no RewriteRules there. One htaccess file is all I have, with the content above in root

--

After some more testing it turns out that Options Multiviews was causing the problem for me. Removed it from the <Directory "{dirpath}"> block and everything works as it should now :)

This post has been edited by No0Vad: 22 September 2010 - 01:14 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1