How can I setup dynamic sub domains?
August 7, 2006 12:09 AM Subscribe
Sub-sub domains with mod_rewrite - can it be done?
I'm setting up a bunch of domains that follow a consistent naming structure (category/subcategory/file.html). I've setup dynamic wildcards on these domains, and I know how to handle pathing dynamically via PHP, but I'm really interested in setting up a solution like this:
user enters http://subcategory.category.domain.com/index.html, which rewrites to domain.com/category/sucategory/index.html, without changing the browser path.
As an added level of complexity, i'd like to be able to use drupal on some of the subpaths, so I need to be able to honor their htaccess to rewrite their query string.
Any help would be much appreciated, oh tech gods of Mefi!
I'm setting up a bunch of domains that follow a consistent naming structure (category/subcategory/file.html). I've setup dynamic wildcards on these domains, and I know how to handle pathing dynamically via PHP, but I'm really interested in setting up a solution like this:
user enters http://subcategory.category.domain.com/index.html, which rewrites to domain.com/category/sucategory/index.html, without changing the browser path.
As an added level of complexity, i'd like to be able to use drupal on some of the subpaths, so I need to be able to honor their htaccess to rewrite their query string.
Any help would be much appreciated, oh tech gods of Mefi!
Response by poster: Great reply PuGZ.
I'm running into trouble with the above ruleset however. It's throwing a 500.
On sub.sub domains - it isn't working at all. If the folder exists, it throws the above mentioned server 500. Any ideas?
posted by Vantech at 1:26 AM on August 7, 2006
I'm running into trouble with the above ruleset however. It's throwing a 500.
On sub.sub domains - it isn't working at all. If the folder exists, it throws the above mentioned server 500. Any ideas?
posted by Vantech at 1:26 AM on August 7, 2006
Response by poster: As expected... it's throwing a mod_rewrite: maximum number of internal redirects reached. to the error_log
posted by Vantech at 1:28 AM on August 7, 2006
posted by Vantech at 1:28 AM on August 7, 2006
D'oh, I posted that without properly reading your question. Give me a little while!
posted by PuGZ at 3:01 AM on August 7, 2006
posted by PuGZ at 3:01 AM on August 7, 2006
This thread is closed to new comments.
posted by PuGZ at 1:05 AM on August 7, 2006