Welcome Guest, Not a member yet? Register   Sign In
subdomains hate me
#1

[eluser]Cameron Steele[/eluser]
I've seen people get angry at people for asking about this, but I assure you I'm on my last limb here. Maybe I'm just stupid, but I've been researching and researching and every time I think I've found the answer in the sea of information, I come up gasping for breath with a handful of nothingness.

All I want is for someone who goes to music.steelecameron.com/example to get rerouted to steelecameron.com/projects/example. Obviously, projects is a controller in my app.

I have:

1. Created A Records in DNS for music.steelecameron.com and www.music.steelecameron.com that point to my server's IP

2. Edited the .htaccess in /public_html to have the following:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteCond %{HTTP_HOST} ^music.steelecameron.com$
RewriteRule ^(.*)$ http://www.steelecameron.com/projects/$1 [L]

And a plethora of other .htaccess code combinations, but all I ever get is my hosts "There is no website configured at this address" message.

Am I editing the wrong .htaccess like an idiot? Do I need to setup the subdomain so that it accesses public_html/music and then edit the .htaccess inside the actual music folder?

I'm going to cry and hurt myself if I don't conquer this sucker real quick-like.
#2

[eluser]Cameron Steele[/eluser]
I fixed it by redirecting music.steelecameron.com to public_html/music and then editing the .htaccess within that folder to include the following:

Code:
RewriteEngine on

RewriteCond %{HTTP_HOST} ^(www.)?music.steelecameron.com(/.*)?(/.*)?$
RewriteRule ^(?:.*/)?(.*)$ http://www.steelecameron.com/projects/$1 [R=302,L]

Can't be sure that's the most optimal route, but it seems to be working.




Theme © iAndrew 2016 - Forum software by © MyBB