httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas Armstrong <>
Subject [users@httpd] htaccess in a directory under one with another htaccess
Date Sun, 26 Oct 2014 12:14:34 GMT

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 and

However, if I try to access or

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
but not with

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.

View raw message