Subdomain configuration |
Hi all
Appreciate this has been covered a few times here and there, but I've tried several solutions and nothing seems to be working for me - so any guidance would be really appreciated! I'm trying to keep things somewhat easy to maintain for myself with shared config and models etc. I have several parts to my CodeIgniter setup which would be accessed through a subdomain, but internally would just be a controller folder. For example:
I've tried a few solutions from Stackoverflow. One in particular seemed to fit my use case better than the others, but I tried this one but this just gives me object not found errors. This is my htaccess based on this: Code: <IfModule mod_rewrite.c> I'm aware this is for wildcard domains, but even if that works, it would be a step forward for me. I have run this through a tester (here), and it's returned fine, so I'm a bit lost as to why it's returning "Object not found". I'm not an expert with htaccess so I've been going around in circles, so any pointers would be great!
I may have been approaching this wrong, I'm not sure. However, I did find a solution which uses hooks instead of the htaccess approach.
I wanted to share in case anyone else was looking for the same sort of set up: https://gist.github.com/chill117/5971561 This does work on CI3 and resolves my issue quite nicely. Hopefully this can help some others in the future - this link seemed to be tricky to find but useful
Hello,
How to set up a subdomain Step 1: Log into your account. The first step is to log into the cPanel dashboard for the website you want to add the subdomain to. Step 2: Add the subdomain. Now, scroll down to the Domains heading and press the Subdomain button. Step 3: Add DNS records. Step 4: Wait for your subdomain to resolve. Regards, Mika Hawkins
Mika Hawkinsss
|
Welcome Guest, Not a member yet? Register Sign In |