Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

htaccess guru wanted :)

I am hoping someone can help me. I am considering moving to a new hosting company so brought up a copy of my website on their servers. Initially I brought it up in a subdomain which on their system means it is in a subfolder of my root web location.

So I had which pointed straight to a folder called wp within my public_html folder. WordPress is installed in the root of this wp folder and Vanilla in a subfolder called forums. Pretty URLS are turned on for both wp and vanilla and so I end up going to to get to my vanilla forums and then everything in there is under this (e.g. etc).

Now this all seems to be going quite well and I decide I want to go live. Unfortunately it turns out that I can't just point the main address to the same wp subfolder folder. The site always has to point to the root of the public_html folder. I don't really fancy moving all the messy WordPress files and folders up there as it will then be mixed in with any folders associated with subdomains.

I managed to come across a URL rewrite rule that solves the problem by redirecting anything for (or to a subfolder. I've placed the following .htaccess file in the public_html folder

RewriteEngine On
RewriteCond %{HTTP_HOST} ^$ [OR]
RewriteCond %{HTTP_HOST} ^$
RewriteCond %{REQUEST_URI} !^/wp/
RewriteRule (.*) /wp/$1

WordPress now works as expected. The only problem I get is that my Vanilla forums now show up as rather than All of normal WordPress pages and images etc show up with the wp folder hidden (e.g. not, it is just Vanilla that is showing the unwanted wp folder in the path.

So finally to the request...does anyone know how to create a rule to hide this and in what folder would I need to place it (public_html, wp or forums)

I already have an .htaccess file in the forums folder that contains the following

RewriteBase /forums
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]




  • Options
    LincLinc Detroit Admin
    edited December 2016

    On a new line after RewriteCond %{REQUEST_URI} !^/wp/ I would try adding RewriteCond %{REQUEST_URI} !^/forums/. That should chain the two rules together and stop anything in that folder from redirecting.

  • Options

    Thanks Linc, unfortunately that caused 404 errors in the forums folder

  • Options

    decided to pull the forums folder out from within wordpress and put it in its own root folder. Keeps vanilla and wordpress separate and still looks the same as the original development site as far as URLs i.e. forums still at

Sign In or Register to comment.