htaccess mod_rewrite error

Discussing Html . Code , Software , other

Moderators: macek, egami, gesf

webqueen79
New php-forum User
New php-forum User
Posts: 1
Joined: Wed Dec 14, 2011 10:17 am

htaccess mod_rewrite error

Postby webqueen79 » Wed Dec 14, 2011 10:19 am

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

Here is my code:

Code: Select all

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteBase /

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


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

Return to “HTML Basics”

Who is online

Users browsing this forum: No registered users and 0 guests