Rewrite url to index.php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    Rewrite url to index.php

    I want that any url other than the ones which end with .css, .js, .ico, .jpg, .png and .gif are sent to index.php
    I am using this code for the same, but it's giving 500 Server error.

    An idea what can the problem be?
    Code:
    RewriteEngine On
    RewriteBase /
    RewriteRule !\.(js|ico|txt|gif|jpg|png|css)$ /index.php
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    maybe you don't have mod_rewrite enabled. try to wrap it in the <ifModule> statement.

    Comment

    • hsriat
      Recognized Expert Top Contributor
      • Jan 2008
      • 1653

      #3
      It is enabled as it works if I change the code a little bit.

      But anyhow, I managed to get it working with another code:..
      Code:
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^(.*)$ index.php [L]
      Thank you very much for looking into the problem.

      Comment

      Working...