Apache server configuration problem.

6 posts / 0 new
Last post
#1 Wed, 02/29/2012 - 14:59
Anonymous

Apache server configuration problem.

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:

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.

Wed, 02/29/2012 - 17:46
andreychek

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

Thu, 03/01/2012 - 00:30
Davvit

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.

Thu, 03/01/2012 - 08:53
andreychek

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

Thu, 03/01/2012 - 09:26
ronald
ronald's picture

that page is actually working for me in the NL, too bad i dont like patatoes :)

Fri, 03/02/2012 - 14:16
Davvit

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:

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]

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.

Topic locked