I have a website foo.com
on wordpress and I want to do this foo.com/mexico
, foo.com/venezuela
, delivery different /server
for each city with the same domain (without wordpress multisite).
I'm not asking about to detect ip by city but server and/or domain/dns configuration to do that.
I know there is other ways to accomplish this, but want to know about this one.
Here is an example:
EDIT SOLUTION
This was my solution:
- Create a subdomain, example.foo.com pointing to another server.
- Create a folder on the main server with the name i wanted for the link, for example 'mexico'
Inside this folder created a .htaccess:
RewriteEngine ON
RewriteCond %{REQUEST_URI} ^/mexico RewriteRule ^(.*)$ http:// example. foo. com/$1 [R=301,L,P
This works for me. If i want another /server
i just repeat with another name, example 'venezuela'. The subdomain name will be hide by the .htaccess and this 'example.foo.com' will look like this 'foo.com/venezuela'.