You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Sam Wootton <sa...@gmail.com> on 2009/02/26 12:50:00 UTC
[users@httpd] download php apache
Hi,
I have a php script in my DocumentRoot.
When i visit "www.example.com" my site works fine. However, if i visit "
http://example.com" it get a download dialog, asking me if i want to
download this php, instead.
Obviously i don't want this - i just want the site to behave as it does when
i use "www".
Here is my VirtualHost directive:
*<VirtualHost 192.168.1.68:80>
ServerName www.example.com
ServerAdmin sam.wootton@gmail.com
DocumentRoot /Users/snapple/Sites/www.example.com/www
<Directory "/Users/snapple/Sites/www.example.com/www/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://www.example.com/$1 [L,R]
</IfModule>
</VirtualHost>*
Any ideas?
Thanks in davance for any help.
Regards, Sam
Re: [users@httpd] download php apache
Posted by Lester Caine <le...@lsces.co.uk>.
Sam Wootton wrote:
>
>
> 2009/2/26 Lester Caine <lester@lsces.co.uk <ma...@lsces.co.uk>>
>
> Sam Wootton wrote:
>
> Hi,
>
> Many thanks for the help.
>
> I tried that, and i still got the same problem.
>
> However, it could be being cached i guess.
>
> Is what you suggested a sure fire way to fix my problem? If so,
> i'll wait until i am home to test it properly.
>
>
> <VirtualHost *>
> ServerName example.com <http://example.com>
> ServerAlias www.example.com <http://www.example.com>
> </VirtualHost>*
>
> Should work
>
> If you move to a live site, then the IP address will be for the
> domain without a www extension anyway.
>
> --
> Lester Caine - G8HFL
> -----------------------------
> Contact - http://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - http://lsces.co.uk
> EnquirySolve - http://enquirysolve.com/
> Model Engineers Digital Workshop - http://medw.co.uk//
> Firebird - http://www.firebirdsql.org/index.php
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> <ma...@httpd.apache.org>
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> <ma...@httpd.apache.org>
> For additional commands, e-mail: users-help@httpd.apache.org
> <ma...@httpd.apache.org>
>
>
> Hi,
>
> Many thanks for the help.
>
> Krist, I rand httpd -s and got:
>
> Processing config directory: /private/etc/httpd/users/*.conf
> Processing config file: /private/etc/httpd/users/+entropy-php.conf
> Processing config file: /private/etc/httpd/users/snapple.conf
> VirtualHost configuration:
> 192.168.1.68:80 <http://192.168.1.68:80> is a NameVirtualHost
> default server www.example.com
> <http://www.example.com> (/etc/httpd/httpd.conf:1104)
> port 80 namevhost www.example.com
> <http://www.example.com> (/etc/httpd/httpd.conf:1104)
>
> Lester, i'm not sure what you mean by:
>
> "If you move to a live site, then the IP address will be for the domain
> without a www extension anyway."
>
> It is on a live site. Sorry - a little confused here.
DNS servers will provide IP address for the base domain name ... so in
my case medw.co.uk has an alocated IP address, and I allow
www.medw.co.uk as an alias, although <anything>.medw.co.uk still reaches
the same apache server ;)
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] download php apache
Posted by Sam Wootton <sa...@gmail.com>.
2009/2/26 Lester Caine <le...@lsces.co.uk>
> Sam Wootton wrote:
>
>> Hi,
>>
>> Many thanks for the help.
>>
>> I tried that, and i still got the same problem.
>>
>> However, it could be being cached i guess.
>>
>> Is what you suggested a sure fire way to fix my problem? If so, i'll wait
>> until i am home to test it properly.
>>
>
> <VirtualHost *>
> ServerName example.com
> ServerAlias www.example.com
> </VirtualHost>*
>
> Should work
>
> If you move to a live site, then the IP address will be for the domain
> without a www extension anyway.
>
> --
> Lester Caine - G8HFL
> -----------------------------
> Contact - http://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - http://lsces.co.uk
> EnquirySolve - http://enquirysolve.com/
> Model Engineers Digital Workshop - http://medw.co.uk//
> Firebird - http://www.firebirdsql.org/index.php
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
Hi,
Many thanks for the help.
Krist, I rand httpd -s and got:
Processing config directory: /private/etc/httpd/users/*.conf
Processing config file: /private/etc/httpd/users/+entropy-php.conf
Processing config file: /private/etc/httpd/users/snapple.conf
VirtualHost configuration:
192.168.1.68:80 is a NameVirtualHost
default server
www.example.com(/etc/httpd/httpd.conf:1104)
port 80 namevhost
www.example.com(/etc/httpd/httpd.conf:1104)
Lester, i'm not sure what you mean by:
"If you move to a live site, then the IP address will be for the domain
without a www extension anyway."
It is on a live site. Sorry - a little confused here.
Regards, Sam
Re: [users@httpd] download php apache
Posted by Lester Caine <le...@lsces.co.uk>.
Sam Wootton wrote:
> Hi,
>
> Many thanks for the help.
>
> I tried that, and i still got the same problem.
>
> However, it could be being cached i guess.
>
> Is what you suggested a sure fire way to fix my problem? If so, i'll
> wait until i am home to test it properly.
<VirtualHost *>
ServerName example.com
ServerAlias www.example.com
</VirtualHost>*
Should work
If you move to a live site, then the IP address will be for the domain
without a www extension anyway.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] download php apache
Posted by Krist van Besien <kr...@gmail.com>.
On Thu, Feb 26, 2009 at 1:02 PM, Sam Wootton <sa...@gmail.com> wrote:
> Hi,
>
> Many thanks for the help.
>
> I tried that, and i still got the same problem.
>
> However, it could be being cached i guess.
>
> Is what you suggested a sure fire way to fix my problem? If so, i'll wait
> until i am home to test it properly.
Try running a "httpd -S" and show us the output.
Krist
--
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] download php apache
Posted by Sam Wootton <sa...@gmail.com>.
Hi,
Many thanks for the help.
I tried that, and i still got the same problem.
However, it could be being cached i guess.
Is what you suggested a sure fire way to fix my problem? If so, i'll wait
until i am home to test it properly.
Regards, Sam
2009/2/26 Matus UHLAR - fantomas <uh...@fantomas.sk>
> On 26.02.09 11:50, Sam Wootton wrote:
> > When i visit "www.example.com" my site works fine. However, if i visit
> "
> > http://example.com" it get a download dialog, asking me if i want to
> > download this php, instead.
> >
> > Obviously i don't want this - i just want the site to behave as it does
> when
> > i use "www".
>
> > *<VirtualHost 192.168.1.68:80>
> > ServerName www.example.com
>
> > </VirtualHost>*
>
> Try specifying "ServerAlias example.com" for the virtual host.
>
> --
> Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
> Warning: I wish NOT to receive e-mail advertising to this address.
> Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
> A day without sunshine is like, night.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
Re: [users@httpd] download php apache
Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 26.02.09 11:50, Sam Wootton wrote:
> When i visit "www.example.com" my site works fine. However, if i visit "
> http://example.com" it get a download dialog, asking me if i want to
> download this php, instead.
>
> Obviously i don't want this - i just want the site to behave as it does when
> i use "www".
> *<VirtualHost 192.168.1.68:80>
> ServerName www.example.com
> </VirtualHost>*
Try specifying "ServerAlias example.com" for the virtual host.
--
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
A day without sunshine is like, night.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org