browser wants to save php file when in alias directory
Posted by: sandyRam (---.pres.cable.virginmedia.com)
Date: March 07, 2010 04:56PM

Hi, hope someone can help, I've been stuck with this problem for a few days and I'm getting nowhere.

I am running wampserver and have so far found it really easy to install and use.
Now I need to set up multiple folders for various projects and wish to use aliases to do so.

I have created a folder 'musicquiz', within the wamp folder - alongside the www folder.
I have created an alias via the wamp menu - and now have music.conf in my wamp/alias folder :

Alias /music/ "c:/wamp/musicquiz/"

<Directory "c:/wamp/musicquiz/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>

Within the 'musicquiz' folder I have some flat html files and some php files.
When I point my browser to [localhost] the file displays correctly, which makes me think that the alias is working correctly.
However, when I try to open one of the php files such as [localhost], my browser (firefox) asks what I want to do with the file: save / open with, rather than the file being processed as a .php file. The same test.php file is processed correctly when I save it in the www folder and simply run [localhost].

It seems that I am missing something, but I don't know what. Have tried several times, used different names, tried manually creating the file etc but still no joy.

Please help!


I have wampserver 2 and am running on Windows 7.

Options: ReplyQuote
Re: browser wants to save php file when in alias directory
Posted by: c2dan (---.15-1.cable.virginmedia.com)
Date: March 07, 2010 06:04PM

Does the file work if you go to http:// localhost/musicquiz/test.php

Why create an alias in the first place? Aliases should only be used for directories that are outside of the document root (eg C:\wamp\www). I'd personally either rename the folder or use mod rewrite. I wouldn't setup an Alias for this setup.

Options: ReplyQuote
Re: browser wants to save php file when in alias directory
Posted by: sandyRam (---.pres.cable.virginmedia.com)
Date: March 07, 2010 07:23PM

Hi, thanks for taking time to reply.
>Does the file work if you go to http:// localhost/musicquiz/test.php
No, because the root is wamp/www and my files are in wamp/musicquiz - surely it would be looking for wamp/www/musicquiz in that case?

I am trying to use an alias because my files are indeed outside of the root - but perhaps they needn't be?
Do you think I could just put the musicquiz directory into the www directory? I guess that should work - I'd access the files by using : http:// localhost/musicquiz/test.php ?? ...and then if I have a second project that I need to keep separate that could be www/newproject/ ?
I will try that - I guess I just wanted to keep it neat and having the files outside of the www directory would have been preferable.

(mod-rewrite is even further out of my capabilities than alias.)

Options: ReplyQuote
Re: browser wants to save php file when in alias directory
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: March 07, 2010 07:45PM

u use vhosts to keep it tidy

not alias

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: browser wants to save php file when in alias directory
Posted by: c2dan (---.15-1.cable.virginmedia.com)
Date: March 07, 2010 09:09PM

Sorry I misread your file paths. Ignore my post. I agree with steven to use virtualhost instead of aliases.

Options: ReplyQuote
Re: browser wants to save php file when in alias directory
Posted by: sandyRam (---.pres.cable.virginmedia.com)
Date: March 07, 2010 10:14PM

Thanks for the input guys. I have a lot to learn, for sure.
virtual host was the answer I was looking for so I have now got the set-up I was hoping for. thanks for the pointer.

(..... I'm now not sure what the point of alias is, but I will figure that out some other day.)

Options: ReplyQuote
Re: browser wants to save php file when in alias directory
Posted by: yfastud (Moderator)
Date: March 08, 2010 11:59PM


Options: ReplyQuote
Re: browser wants to save php file when in alias directory
Posted by: sandyRam (---.pres.cable.virginmedia.com)
Date: March 09, 2010 12:24PM

Thanks to everyone for their input, vhost worked perfectly, if anyone else is doing vhost set up as a newbie, I can recommend this page for clear instructions:
[apptools.com]

Another tip for Windows 7 users - be default, you cannot edit and save changes to your hosts file, even if your user account has administrative privileges. There is a way around this as described here:
[www.windowsreference.com]

Options: ReplyQuote


Sorry, only registered users may post in this forum.