Title: Multisite permalinks for subfolder wordpress installation
Last modified: August 22, 2016

---

# Multisite permalinks for subfolder wordpress installation

 *  Resolved [AlexeyKosov](https://wordpress.org/support/users/alexeykosov/)
 * (@alexeykosov)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/multisite-permalinks-for-subfolder-wordpress-installation/)
 * I have WordPress installed in a subfolder of the main site: [http://www.mysite.com/blog/](http://www.mysite.com/blog/)
   
   Now I need to add second blog on [http://www.mysite.com/blog/second/](http://www.mysite.com/blog/second/)
   So 2 blogs should work on the following URLs: [http://www.mysite.com/blog/](http://www.mysite.com/blog/)
   [http://www.mysite.com/blog/second/](http://www.mysite.com/blog/second/)
 * I configures WordPress and almost everything works fine, but I have a little 
   issue with the main blog ([http://www.mysite.com/blog/](http://www.mysite.com/blog/)),
   the post URLs look like /blog/blog/hello-world/ rather than /blog/hello-world/.
   
   Second blog URLs work properly.
 * I tried to change permalink structure in site settings to /%postname%/, and all
   URLs look good after that, but all they cause 404 error.
 * How can I get rid of double /blog mention in this case? Thanks in advance!
 * wp-config settings:
 *     ```
       /* Multisite */
       define( 'WP_ALLOW_MULTISITE', true );
       define('MULTISITE', true);
       define('SUBDOMAIN_INSTALL', false);
       define('DOMAIN_CURRENT_SITE', 'www.mysite.com');
       define('PATH_CURRENT_SITE', '/blog/');
       define('SITE_ID_CURRENT_SITE', 1);
       define('BLOG_ID_CURRENT_SITE', 1);
       ```
   
 * htaccess:
 *     ```
       RewriteEngine On
   
       RewriteBase /blog/
       RewriteRule ^index\.php$ - [L]
   
       # add a trailing slash to /wp-admin
       RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
   
       RewriteCond %{REQUEST_FILENAME} -f [OR]
       RewriteCond %{REQUEST_FILENAME} -d
       RewriteRule ^ - [L]
       RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
       RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
       RewriteRule . index.php [L]
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [11 years, 8 months ago](https://wordpress.org/support/topic/multisite-permalinks-for-subfolder-wordpress-installation/#post-5247024)
 * > I configures WordPress and almost everything works fine, but I have a little
   > issue with the main blog ([http://www.mysite.com/blog/](http://www.mysite.com/blog/)),
   > the post URLs look like /blog/blog/hello-world/ rather than /blog/hello-world/.
 * Sure, because that’s how Multisite works with subfolders.
 * There’s a KIND of work around.
 * Go to Network Admin -> Sites -> (root site) Permalink Structure -> `/%postname%/`
 * Or whatever you want it to be.
 * Keep in mind, if your permalinks refresh that will restore the /blog/ folder.
 * Google “wordpress multisite remove blog from permalinks” if you want to see all
   the drama about this.
 *  Thread Starter [AlexeyKosov](https://wordpress.org/support/users/alexeykosov/)
 * (@alexeykosov)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/multisite-permalinks-for-subfolder-wordpress-installation/#post-5247026)
 * Did you read my message carefully?
 * > I tried to change permalink structure in site settings to /%postname%/, and
   > all URLs look good after that, but all they cause 404 error.
 * The solution was to clear WordPress internal rewrite rules with
 *     ```
       function flush_site_rules(){
       global $wp_rewrite;
       $wp_rewrite->flush_rules();
       }
       add_filter("wp_loaded","flush_site_rules");
       ```
   
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [11 years, 8 months ago](https://wordpress.org/support/topic/multisite-permalinks-for-subfolder-wordpress-installation/#post-5247027)
 * Site Settings and Network Admin -> Site -> Settings may not mean the same thing.
   I’m good, but not a mind reader 😉 So It pays for me to be specific.
 * Be very careful with that flush. It may actually force revert you back to using/
   blog/ (especially should you visit the permalinks settings on the per-site permalink
   page).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Multisite permalinks for subfolder wordpress installation’ is closed 
to new replies.

## Tags

 * [multisite](https://wordpress.org/support/topic-tag/multisite/)
 * [permalink](https://wordpress.org/support/topic-tag/permalink/)
 * [subfolder](https://wordpress.org/support/topic-tag/subfolder/)

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 3 replies
 * 2 participants
 * Last reply from: [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/multisite-permalinks-for-subfolder-wordpress-installation/#post-5247027)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
