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



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:


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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.