Re: Dynamic Subdomains as Parameter

2012-11-24 Thread Andras Kende
Hello, You could do something like this to start: protected function _getSubDomain() { $url = explode('.', $_SERVER['HTTP_HOST']); return $url[0]; } public function index() { $locale = $this->_getSubDomain();

Dynamic Subdomains as Parameter

2012-11-24 Thread treckstar
Hi everyone. I am working on a little project to learn more about Cake that involves using a "locale" as a sub domain. An example of a popular website that incorporates this type of functionality is craigslist. ex: pittsburgh.craigslist.org I am running the latest version of Cake, 2.2.3 on a

Re: Dynamic Subdomains

2008-01-07 Thread Kjell Bublitz
I think you have to create a wildcard domain entry into your "hosts" file, pointing to localhost. Somthing like *.myproject.com 127.0.0.1 Within Apache config you have to simply create a VirtualHost (extras folder) and point the SeverName to "domainname.com" and any subdomain you give should catc

Dynamic Subdomains

2008-01-07 Thread bob
How do you setup a dynamic subdomain in CakePHP? Is there any modifications in Apache that I have to make? I am using Xampp. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this g

Re: Dynamic Subdomains and Wildcard DNS

2006-07-10 Thread brandags
That makes sense. My application will also be using the same database and folders. I've been experimenting a little and have come up with a solution that's working fairly well, but just needs a little tweaking. I actually didn't need to use .htaccess at all, but used routes to route all requests t

Re: Dynamic Subdomains and Wildcard DNS

2006-07-10 Thread Martin
Thought Iäd explain further: The reason I load one bootstrap and one database file for each subdomain is that they all need their own specific settings. In my application, each domain represents a completely "seperate" application running its own database and other settings. for example: client1.

Re: Dynamic Subdomains and Wildcard DNS

2006-07-04 Thread gwoo
@brandags: using your example, it should be pretty easy to adapt for cake htaccess. RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{HTTP_HOST} ^([^.]+)\.?myfamilyswing\.com [NC] RewriteCond %1 !^(www)?$ [NC] R

Re: Dynamic Subdomains and Wildcard DNS

2006-07-04 Thread brandags
Thank you for sharing your method! It does seem like that would work. Am I understanding correctly that you're creating an additional bootstrap.php file for each domain? It seems like there should be a way to do it dynamically so that no additional files are required. I did this on a non-Cake site

Re: Dynamic Subdomains and Wildcard DNS

2006-07-03 Thread Martin
Disregarding the Apache and DNS setup and focusing on CakePHP, these are my thought on the subject at the moment. I too have the clientname.example.com setup and have so far copied my app for each subdomain. This works great until I start patching and bugfixing... I need to sync to a lot of folde

Re: Dynamic Subdomains and Wildcard DNS

2006-07-03 Thread brandags
Okay, never mind. It looks like although view.php copied over, the filesize was 0, so obviously it couldn't read what it needed to. FTP upload problem, I guess. Although, I still haven't figured out dynamic subdomains. I guess I'll address that more w

Dynamic Subdomains and Wildcard DNS

2006-07-03 Thread brandags
Hello, I'm trying to create a site where users can have their own subdomain, which will be created dynamically: http://john.myfamilyswing.com http://suzie.myfamilyswing.com etc. So I had my web host enable wildcard DNS in Apache, but for some reason, Cake is acting as if it can't find all the fi