Title: Subdirectory Domain Issue
Last modified: October 5, 2018

---

# Subdirectory Domain Issue

 *  [jasonfenty](https://wordpress.org/support/users/jasonfenty/)
 * (@jasonfenty)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/subdirectory-domain-issue/)
 * I have a unique situation where I had to set up a multisite at siteexample.com/
   wp. So what I’m trying to accomplish is that the subdirectories have to be developed
   first and then they will use an addon domain.
 * So for example, siteexample.com/wp/firstsite becomes myfirstsite.com. And siteexample.
   com/wp/secondsite is still in development.
 * My problem is that in order to get the domain to work, I have to edit the .htaccess.
   It gives me a 500 internal server error. But when the domain works, the subdirectories
   stop working and give me a 404 error. And when the subdirectories work, the domain
   stops working.
 * This is the code that allows the subdirectories to work:
    RewriteEngine On RewriteBase/
   wp/ 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]
 * And this is the code that allows the domain to work:
    RewriteEngine On RewriteBase/
   wp/ 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]
 * Is there a way that will allow both to work?

Viewing 1 replies (of 1 total)

 *  [JNashHawkins](https://wordpress.org/support/users/jnashhawkins/)
 * (@jnashhawkins)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/subdirectory-domain-issue/#post-10754053)
 * I think I’d run WordPress from the web root first and then use the built-in mapping
   in WordPress multi-site to map the domain name once I’m up and running. Trying
   to do this via htaccess while running from a subdirectory is just too difficult
   when multi-site runs so well using its internal mapping.
 * Here’s how to run WordPress from the root deomain while most of it is installed
   in a sub-directory [https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory](https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory).
 * The mapping is done by editing the ‘sites’ data from the Network dashboard. [https://codex.wordpress.org/WordPress_Multisite_Domain_Mapping](https://codex.wordpress.org/WordPress_Multisite_Domain_Mapping)
 * You may need to let your hosting control panel know about your extra addon domains
   but all your domains will point to the same IP address(es) used by the main domain.

Viewing 1 replies (of 1 total)

The topic ‘Subdirectory Domain Issue’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [JNashHawkins](https://wordpress.org/support/users/jnashhawkins/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/subdirectory-domain-issue/#post-10754053)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
