Note that there are some explanatory texts on larger screens.

plurals
  1. POHTACCESS: Change domain root to sub-directory
    text
    copied!<p>I'm trying to use a sub-directory as the root folder for one of my domains. Using .htaccess, I use mod_rewrite's to get the job done. Here's the code I already have:</p> <pre><code>RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ RewriteCond %{REQUEST_URI} !^/domain/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /domain/$1 RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ RewriteRule ^(/)?$ /domain/index.php [L] </code></pre> <p>This gets the job done, but not entirely. For example:</p> <p>If I goto <a href="http://domain.com/" rel="noreferrer">http://domain.com/</a>, it displays <code>index.php</code> from inside the <code>domain</code> folder. If I goto <a href="http://domain.com/test/" rel="noreferrer">http://domain.com/test/</a>, it will display the contents (or 403) of the <code>test</code> folder. <strong>BUT</strong> if I goto <a href="http://domain.com/test" rel="noreferrer">http://domain.com/test</a> (for use of shortcuts, or even to display the folder) I get redirected to <a href="http://domain.com/domain/test/" rel="noreferrer">http://domain.com/domain/test/</a>.</p> <p>That is not supposed to happen. If anything, it either does a mask from the .htaccess (if test is being used) or should just goto <a href="http://domain.com/test/" rel="noreferrer">http://domain.com/test/</a>. I have tried to figure out a way around this, and I cannot. So I am seeking your help! :)</p> <p>Any and all help is greatly appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload