htaccess mod_rewrite problem

I am having a problem redirecting a url using the htaccess mod_rewrite syntax.

Here is my code:

[code]
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^category/([0-9]+)/$ /category_new.php?id=$1 [L]

[/code]

I am using a php template system where the file structure is like:
images/
pages/
templates/
includes/
style/

The htaccess file is in the root directory. The category_new.php file is in the pages/ folder.
When I try to go to: http://www.url.com/category/9/

I get:

Page not found

  • /home/url/public_html/pages/category/9.php

If the file category_new.php is located in the pages/ directory, the rewrite rule must look like this:

RewriteRule ^category/([0-9]+)/$ /pages/category_new.php?id=$1 [L]

Ok, thanks! I got that to work but only in safari. It does not work in IE. Why is that?

Sponsor our Newsletter | Privacy Policy | Terms of Service