htaccess redirect to subfolder with exception

admin

Administrator
Staff member
I've searched quite a lot without finding a solution.

I have a wordpress blog in
Code:
/_wp
and something else in
Code:
/other

What I'm trying to is that every request gets redirected to the WordPress. Except those to
Code:
/other
and its child directories. I also want the access to the blog to be rewritten. Few examples to make it clear:

Code:
/ --> /_wp/

/ablogpost --> /_wp/ablogpost

/other --> /other

/other/bingou --> /other/bingou

I've tried a few things but what seems the most logical to me is:

<ul>
<li>don't touch the .htaccess of /_wp/ and of /other/</li>
<li>edit the .htaccess of the root '/' by adding:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?mywebsite.com$
RewriteCond %{REQUEST_URI} !^(/other|/other/.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?(.*)$ /_wp/$1
</li>
</ul>

If you could tell me what is wrong there it would be great!

<h1>EDIT</h1>

After changing the index the subfolders were still not working here was my .htaccess back then:

Code:
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
&lt;Limit GET POST&gt;
   order deny,allow
   deny from all
   allow from all
&lt;/Limit&gt;
&lt;Limit PUT DELETE&gt;
   order deny,allow
   deny from all
&lt;/Limit&gt;
AuthName site.com
# BEGIN WordPress
&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
&lt;/IfModule&gt;
# END WordPress

<h1>EDIT 2</h1>

In the end it was a host problem thanks for your help though! Your answer works just well