php - mod_rewrite interaction between two .htaccess files
Get the solution ↓↓↓Solution:
As already been mentioned in comments/answer that Apache .htaccess is per-directory directive. Apache only uses closest/nearest .htaccess so in your case it is only using/product/blog/.htaccess
and ignoring/.htaccess
:
You can use this directive at top of your/product/blog/.htaccess
:
RewriteOptions InheritBefore
This will make rules from the parent scope are applied before rules specified in the child scope.
Answer
Solution:
This is from the official documentation,
The configuration directives found in a .htaccess file are applied to the directory in which the .htaccess file is found, and to all subdirectories thereof. However, it is important to also remember that there may have been .htaccess files in directories higher up. Directives are applied in the order that they are found. Therefore, a .htaccess file in a particular directory may override directives found in .htaccess files found higher up in the directory tree. And those, in turn, may have overridden directives found yet higher up, or in the main server configuration file itself.
http://httpd.apache.org/docs/trunk/howto/htaccess.html#how
I'm guessing your question is why it's not being 301 redirected.
Without looking too much into it, I'm going to say that it has to be do with content already being served. If content has already been served, the 301 header probably can't be set.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: videoxxx
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.