5
votes

I have the file structure

   index.php
   .htaccess
   news/index.php
   news/.htaccess

first .htaccess:

    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteCond %{REQUEST_URI} !^/news/
    RewriteRule . /index.php [L]

second (news/.htaccess)

    RewriteEngine On
    RewriteRule . /index.php

Request http://test.t/news/news/61 the handles first index.php but I need to do it the second

I tried a few more options for the first .htaccess, but it did not succeed

1

1 Answers

3
votes

Check your Apache config file (httpd.conf) and make sure the directory you are using for your site includes the AllowOverride option.

Example:

<Directory "/Applications/MAMP/htdocs">
    Options All
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>