Jump to content

problems creating aliases.


yaqub

Recommended Posts

Hi -

I am trying to add aliases to my config file so I can follow along with Beg. PHP5 and MySQL E-Comm. I'm trying to add this


Alias /tshirtshop/ "c:/tshirtshop/"
Alias /tshirtshop "c:/tshirtshop"

But when I restart Apache(I'm using 2.0.59 by the way) and try to test I get an error page. I also have a test.php file that I'm trying to call. So my "url" is http://localhost/tshirtshop/test.php

Can someone give me a hand asap I really need this help fast, Im buiding a site and learning as I go starting off real good as you can see.

Now I have maybe fixed something. I rewrote the php code in Dreamweaver so now I don't get the 404 page cannot be found. Now I get a blank page. With this code if all is working properly should I see the php icon?.....

<?php phpinfo();?>

Cause like I said before rewriting the code I was getting an error page(notepad adding the .txt after .php) but now there's nothing displayed on the page. Even if I do a simple Hello World basic php script nothing get's displayed.

Any answers? I can email the config file if that will help.



Thanks
Link to comment
Share on other sites

When you got to http://localhost/tshirtshop/test.php and right click and select view source do you see your PHP coding? If you do then Apache is not setup.

You need to setup Apache to parse PHP files with the PHP Interpreter. I have posted a few posts in this forum how to do this, such as [url=http://www.phpfreaks.com/forums/index.php/topic,108327.msg435982.html#msg435982]this post[/url].
Link to comment
Share on other sites

Hi-

Thanks for the reply. I did get it to display my php code which was just a date test if you will. But my main problem seems to be getting it to use an "aliase" I think. Right now what works is http://localhost/date.php, but the date.php file is in a folder called prorider. If I put http://localhost/prorider/date.php I get the usual cannot find page error. I've even tried http://prorider/date.php same message.

From what I think is that apache isn't recognizing that I have made prorider the "default" folder. Excuse me if my names or terms are wrong. Root folder is the correct way of putting it I guess. In the tutorial I was following we were supposed to add an alias in apache's config file which would be used as the virtual root folder(once again terms probably wrong).

Link to comment
Share on other sites

When creating an Alias you need to setup an Alias using the Alias directive, which you have done.

Then you need to have a corresponding directory directive, like so:
<Directory "alias-path-here">
    Directory saettings here
</directory>

For example for the tshirtshop alias you'll need this:
[code]Alias /tshirtshop/ "C:/tshirtshop/"
<Directory "C:/tshirtshop">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>[/code]
Now save the httpd.conf and restart Apache. Now put your files in C:\tshirtshop and go to http://localhost/tshirtshop/

You should now see the files you have just placed in C:\tshirtshop or your index file will load up automatically.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.