Forum Moderators: phranque

Message Too Old, No Replies

301 redirection does not work for some folder

because there is another .htaccess file in this folder

         

iProgram

12:18 pm on Jul 27, 2005 (gmt 0)

10+ Year Member



I use 301 redirection to solve www./non www. problem. Here is my .htaccess under root of website

RewriteEngine on
RewriteCond %{HTTP_HOST}!^www\.site\.com
RewriteRule (.*) [site.com...] [R=301,L]

It can redirect site.com/test.html to www.site.com/test.html

But it does not work with site.com/abc/ because there is another .htaccess file under /abc/folder:

RewriteEngine On
RewriteRule ^somefile.html$ /abc/file.php [L]

How to solve this problem?

jdMorgan

1:02 pm on Jul 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Add

RewriteOptions inherit

to the .htaccess in your subfolder, following the "RewriteEngine on" directive.

Jim

iProgram

1:35 pm on Jul 27, 2005 (gmt 0)

10+ Year Member



I add this to .htaccess of my subfolder:
RewriteEngine On
RewriteOptions inherit
RewriteRule ^somefile.html$ /abc/file.php [L]

But site.com/abc/ will direct to www.site.com