htaccess in a directory under one with another htaccess

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

On my Apache Server, I have this structure to host a website under '/' and a WordPress blog under '/myblog' directory:
--- root_directory/.htaccess
--- root_directory/php_stuff
--- root_directory/myblog/.htaccess
--- root_directory/myblog/php_wp_stuff

Within 'root_directory/.htaccess' file I have several RewriteRules:
--------
RewriteRule ^item/([^/]+)/ /item.php?label1=$1 [L]
RewriteRule ^([^/]+)/([^/]+)/$ /category.php?label1=$1&label2=$2 [L]
-----------------------
which work with
http://www.example.com/item/book-10003/ and
http://www.example.com/science/maths/

However, if I try to access
http://www.example.com/myblog/ or
http://www.example.com/myblog/hello-world/

I got a 404 error. So I modififed the .htaccess:
------------------
RewriteRule ^myblog - [L,NC]
RewriteRule ^item/([^/]+)/ /item.php?label1=$1 [L]
RewriteCond %{REQUEST_URI} !^/myblog/
RewriteRule ^([^/]+)/([^/]+)/$ /category.php?label1=$1&label2=$2 [L]
-------------------
I tried to avoid 'myblog' directory to be ruled by the 'RewriteRules'. However, it works with

http://www.example.com/myblog/
but not with http://www.example.com/myblog/hello-world/

What am I doing wrong? I also tried by adding these lines at the bottom of .htaccess, but I does not work:
--------------
RewriteBase /myblog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /myblog/index.php [L]
--------------------
Any tip is welcome. Thank you very much.

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux