I need to be able to create subdomains for a bunch of urls on a site,

from:
domain.ca/communities/city/nw/neighbourhood/

to:
neighbourhood.domain.ca

There are a couple of things that change in the structre of the urls that need to be taken into account for this to work.

Notice that all the urls will have this in common domain.ca/communities/city/

and that the site is structure as follows: Arbour Lake being a "community" within the "NW" quadrant of my city "city" so the url will look like this

so use this as an example: domain.ca/communities/city/nw/arbour_lake/

how do i use htaccess to make into this new subdomain neighbourhood.domain.ca

So the url will change depending on where that community is located it will be either NW, NE, SW, SE and Nearby for a couple of neighbouring communities to our cities. in which case it looks like this:

domain.ca/communities/city/nearby/dewinton/

What kind of snippet can i paste into my htaccess file that will re-write ALL MY "community_pages" and use the name of the page as the root of the url followed by .domain.ca

I forgo to mention that while these are "virtual urls with no/index.html file on that location" the folders do exist and follow the same tree structure.

I am using wordpress and i tried SEO Redirection based on another thread on SO, but it would require for me to pu ch everything in manually.

Thanks in advanced, any help would be greatly appreciated.

migrated from stackoverflow.com Aug 4 '14 at 14:28

This question came from our site for professional and enthusiast programmers.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.