Title: WordPress subdomain or subpath
Last modified: March 30, 2023

---

# WordPress subdomain or subpath

 *  [Haja](https://wordpress.org/support/users/hajakutbudeen/)
 * (@hajakutbudeen)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/wordpress-subdomain-or-subpath/)
 * Hello,
 * I am running a single eCommerce WordPress site with the domain name example [http://www.website.com](http://www.website.com/).
   We have also added subdomains on our server, such as bahrain.website.com and 
   saudi.website.com.
 *  and Bahrain.
 * We have installed the GeoIP addon, which allows us to detect the user’s location.
 * We would like to change our site’s domain name based on the user’s location. 
   For instance, if a user visits from Bahrain, we want to dynamically change our
   domain name to bahrain.website.com. Similarly, if a user visits from Saudi Arabia,
   we want to change our domain name to saudi.website.com.
 * Is it possible to achieve this in WordPress? Or Is there anyway to do same concept
   with subpath like website.com/bh and website.com/sa
 * Kindly advise us on the best approach to implement this functionality.

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

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/wordpress-subdomain-or-subpath/#post-16608898)
 * By default and in most cases ever, WordPress runs on a single domain only. You
   can point other domains to it, but it will always try to force the main “primary”
   domain.
 * I did find [this plugin](https://wordpress.org/plugins/multiple-domain/), but
   it hasn’t been updated in a while, so I don’t know if it would work with the 
   latest versions.
 * Apart from that, if you need two domains, you will need two sites, or set up 
   a Network site with two separate sites.
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/wordpress-subdomain-or-subpath/#post-16609915)
 * It is feasible to dynamically alter the domain WP thinks it should use. See [this section](https://developer.wordpress.org/apis/wp-config-php/#wp-siteurl)
   about editing wp-config.php. You’re interested in the dynamic part at the end
   of the section, as well as the dynamic part of the subsequent Blog Address section.
 * I have not verified, but I suspect this is what the plugin that catacaustic linked
   to does without the need to edit code.

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

The topic ‘WordPress subdomain or subpath’ is closed to new replies.

## Tags

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

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 3 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/wordpress-subdomain-or-subpath/#post-16609915)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
