Note that there are some explanatory texts on larger screens.

plurals
  1. PO.htaccess remove subdirectory name from all URLs
    primarykey
    data
    text
    <p>I was digging the net and haven't found any proper solution for this issue. Basically, I want to remove subdirectory (<strong>subdirname</strong>) name from all URLs, e.g.:</p> <pre><code>http://test.com/subdirname/ http://test.com/subdirname/content/ http://test.com/subdirname/content/newpage </code></pre> <p>The website is based on Wordpress and located in <strong>/subdirname</strong>. I've got two .htaccess files, one in root directory:</p> <pre><code># Turn on URL rewriting RewriteEngine On # Installation directory RewriteBase / # Protect hidden files from being viewed &lt;Files .*&gt; Order Deny,Allow Deny From All &lt;/Files&gt; # Protect application and system files from being viewed RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L] # Allow any files or directories that exist to be displayed directly RewriteCond %{REQUEST_FILENAME} !-f #RewriteCond %{REQUEST_FILENAME} !-d #RewriteCond %{REQUEST_URI} !^(/var|/static) #RewriteCond %{REQUEST_URI} !^(/index\.php|/var|/static) # Rewrite all other URLs to index.php/URL RewriteRule .* index.php/$0 [PT] RewriteCond %{HTTP_HOST} ^(www\.)?test\.com$ [NC] RewriteCond %{REQUEST_FILENAME} !/subdirname/ RewriteRule ^(.*)$ /subdirname/$1 [L] </code></pre> <p>and second in /subdirname/ directory:</p> <pre><code># BEGIN WordPress &lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase /subdirname/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /subdirname/index.php [L] &lt;/IfModule&gt; # END WordPress </code></pre> <hr> <p>If anyone has some tips how to solve it, please advice.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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