|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
I need to get a subdomain on my website. I have DNS wildcards enabled but I don't have access to any config files because I am on a remote host. I have tried rewrite_mod with no succes. My website is http://123-makeme.com and I would like counter.123-makeme.com to go to 123-makeme.com/signup. Any help on this would be great. Thanks.
|
|
#2
|
|||
|
|||
|
>> I don't have access to any config files because I am on a remote host
I hope you have access to httpd.conf. It's better to put the following stuffs to httpd.conf than .htaccess. RewriteEngine on RewriteCond %{SERVER_NAME} ^counter\.123-makeme\.com$ RewriteRule ^(.*) http://123-makeme.com/signup/ [R,L] |
|
#3
|
|||
|
|||
|
No, I don't have access to the httpd.conf. Thats the problem. I know I need to add this to my .htaccess file but is it in the www dir or before that?
|
|
#4
|
|||
|
|||
|
>> is it in the www dir or before that?
What www dir? Just put that .htaccess in your docroot. In URL, that is http://123-makeme.com/.htaccess Make sure http://123-makeme.com is your default domain or default vhost. Your counter.123-makeme.com doesn't need to be a vhost. Since you have wildcard enabled, when people trying to reach your site via http://counter.123-makeme.com, it will resolve to the IP of your default domain. It won't work if 123-makeme.com is not your default domain or default vhost. Anyhow, don't worry about this for the moment, just put that .htaccess in the right location. |
|
#5
|
|||
|
|||
|
OK, I did that. I think its somthing with my host because it refers to thier site so I put in a request and I'll let you know how it turns out. Thanks.
|
|
#6
|
|||
|
|||
|
RewriteEngine on
RewriteCond %{SERVER_NAME} ^counter\.123-makeme\.com$ RewriteRule ^(.*) http://123-makeme.com/signup/ [R,L] Thats my code and it gives me a 500 error when I open my site. Any ideas? |
|
#7
|
|||
|
|||
|
Say http://123-makeme.com/ has a docroot as: /home/httpd/htdocs
Within <Directory "/home/httpd/htdocs"> there should be a AllowOverride line. Make sure FileInfo is included. If you use a Directive in your .htaccess which is not allowed to, you would get 500 error. That said, in order to use any Rewrite Directive (except RewriteMap which can't be in .htaccess in any way) in .htaccess, you must have AllowOverride FileInfo. |
|
#8
|
|||
|
|||
|
I don't know what you mean, I've been to the Apache website and couldn't figgure it out so could you please help me? Thanks.
|
|
#9
|
|||
|
|||
|
>> Say http://123-makeme.com/ has a docroot as: /home/httpd/htdocs
1) What is your docroot (DocumentRoot)? >> Within <Directory "/home/httpd/htdocs"> 2) Within <Directory "/your/docroot/path"> >> there should be a AllowOverride line 3) Something like: <Directory "/your/docroot/path"> blah blah blah blah AllowOverride xxx </Directory> >> Make sure FileInfo is included 4) <Directory "/your/docroot/path"> blah blah blah blah AllowOverride FileInfo </Directory> >> If you use a Directive in your .htaccess which is not allowed to, you would get 500 error. 5) In order to use RewriteEngine and all others (except RewriteMap), you need to tell Apache to read Rewrite lines by reading (4) above. If you don't do this, Apache won't read your .htaccess (with Rewrite lines in it) and return a [500] error. What don't you understand now? If you are still in trouble with this, I strongly suggest you to give up on Apache and use IIS. |
|
#10
|
|||
|
|||
|
Subdomain tutorial
Is there a subdomain tutorial available anywhere on the net?
I'm looking for extensive information on this subject, Is Rewrite only way to do subdomain hosting? |
|
#11
|
|||
|
|||
|
>> Is there a subdomain tutorial available anywhere on the net?
Dunno. You may do a search here in Apache forum. Anyhow, the must do prerequisite is to make sure that subdomain is DNS (forward lookup) resolvable. Enabling wildcard or adding cname or A record, doesn't matter depending on the number of subdomains. >> Is Rewrite only way to do subdomain hosting? Definitely no. mod_rewrite is extremely powerful with regex and various conditions plus the extensive use of environment variables which make configuring subdomain alot easier. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > subdomain |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|