Welcome to WebmasterWorld Guest from 107.20.75.63

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

How can I Reset .htaccess In a Subfolder?

     
7:57 pm on Jul 5, 2010 (gmt 0)

Full Member

10+ Year Member

joined:Mar 8, 2005
posts:234
votes: 0


How can I Reset .htaccess In a Subfolder?

I have a WordPress blog in the root directory and a shopping cart in the /store subfolder. Unfortunately, this combination messes-up the reports in the carts admin section. I traced it back to .htaccess in the root folder.

Since I do not need the WP .htaccess stuff in the shopping cart, can I add a .htaccess to the /store subfolder that will clear those settings? If so, what should be in it?

Thanks!
8:57 pm on July 5, 2010 (gmt 0)

Full Member

10+ Year Member

joined:Mar 8, 2005
posts:234
votes: 0


I was doing some research. Will this work?

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/store
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
12:54 am on July 6, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 15, 2003
posts:2395
votes: 0


.htaccess files work in a hierarchical fashion.

If you place a .htaccess file in a subfolder that file will overrule .htaccess files on higher levels (eg. the one in the root folder)

So, just upload an empty one to the subfolder. That should do the trick.
5:37 am on July 6, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


That's not quite correct.

They are processed in a hierarchical fashion. That is, the rules in the root file are processed first, and then the rules in the sub-folder are processed.
2:49 am on July 10, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


And to add yet another dimension, there's "RewriteOptions inherit" and "RewriteOptions none".

However, this affects only mod_rewrite directives, and not all .htaccess directives.

Jim
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members