system
February 29, 2012, 8:59pm
1
Hi,
I want to have pages accessed by using a sub-directory format.
for example :
This page:
http://www.simpg.net/disp_page.php?a=potatoes
access via by: potatoes.simpg.net
So I wrote this in the htaccess:
RewriteCond %{HTTP_HOST} ^([^.]+).simpg.net [NC]
RewriteCond %{HTTP_HOST} !^www.simpg.net [NC]
RewriteRule ^.*$ http://simpg.net/disp_page.php?a=%1 [NC,QSA,L]
And I accessed the Apache server configuration file at:
etc/httpd/conf/httpd.conf
and added an alias so the file reads:
<VirtualHost 65.23.129.163:80>
SuexecUserGroup “#555 ” “#516 ”
ServerName simpg.net
ServerAlias www.simpg.net
ServerAlias *.simpg.net
DocumentRoot /home/simpy/public_html
ErrorLog /home/simpy/logs/error_log
Then I restarted the Apache server.
I thought this would be enough to make it work how I want.
BUT I still get the error:
Firefox can’t find the server at potatoes.simpg.net .
What else do I need to do ?
Thanks for any help.
Eric
February 29, 2012, 11:46pm
2
Howdy,
It sounds like you added a wildcard entry to Apache – but you’d also need some sort of wildcard DNS entry in order to make potatoes.simpg.net resolve to your server.
You can add DNS records in Server Configuration -> DNS Records.
-Eric
system
March 1, 2012, 6:30am
3
Thanks for that suggestion.
I have now added the wild card record to the DNS
Do I need to wait for it to “propergate” or something ?
Cos I still get the error:
Firefox can’t find the server at potatoes.simpg.net .
This is screen shot of my DNS:
http://www.sd5.info/simpg01.jpg
Is there something else do I need to do ?
Thanks.
Eric
March 1, 2012, 2:53pm
4
Yeah your ISP’s DNS may have cached the previous response you got… as I’m able to perform a lookup on that domain. You may just need to wait a day or so for the cache to clear.
-Eric
ronald
March 1, 2012, 3:26pm
5
that page is actually working for me in the NL, too bad i dont like patatoes
system
March 2, 2012, 8:16pm
6
Yes,
It took a few of hours but now the it works well EXCEPT if there is a period in the
string.
This is what I have:
[code]RewriteCond %{HTTP_HOST} ^([^.]+).simpg.net [NC]
RewriteCond %{HTTP_HOST} !^www.simpg.net.net [NC]
RewriteRule ^.*$ http://simpg.net/disp_page.php?a=%1 [NC,QSA,L]
[/code]
So this works fine with :
potatoes.simpg.net
that goes to simpg.net/disp_page.php?a=potatoes
and the page displays - Great if you like Potatoes
BUT if I have
http://recipes.potatoes.simpg.net/
And that just goes to the index page.
It should go to : simpg.net/disp_page.php?a=recipes.potatoes
Which would work fine.
Do you know how I should adjust my htaccess above ?
Thanks.