PDA

View Full Version : Using aliases in php.ini



srgroves
07-16-2010, 01:25 AM
I'm building a site where users have profiles that I'd like to be located at:

http://www.mysite.com/profile/username/

When a user goes to that URL, I'd like to load a file, say profile.php located in the www folder. Also, I'd need to have some way of knowing which username was typed in the URL so profile.php can pull that user's data from the db.

It seems like aliases are the normal way of doing this, but I can't find any info regarding using aliases in php.ini -- it doesn't look like Hostmonster supports mod_rewrite in .htaccess files, and I'm not sure if this can be done using mod_rewrite anyway.
Is there a way to do this in php.ini or by some other means?

Thanks in advance.

shadmego
07-16-2010, 05:25 AM
Hostmonster does in fact support mod_rewrite. My site uses it extensively, though I didn't write any of the htaccess code (my site is Joomla!). I'm horrible when it comes to htaccess and mod_rewrite prowess. The resident expert here is Falcon.

srgroves
07-16-2010, 11:52 AM
Do you know how to enable mod_rewrite? I followed this (http://billing.handsonwebhosting.com/knowledgebase.php?action=displayarticle&id=119) to check if it's enabled and got a 500 error.

Falcon1986
07-16-2010, 08:52 PM
I, too, can confirm that mod_rewrite is supported on HostMonster servers. You might be getting internal server errors because:

There is an error in the .htaccess code syntax, or
You are using statements that are no longer supported.

Concerning the latter, you can try changing this line...

Options +FollowSymLinks
To this...

Options +SymLinksIfOwnerMatch
To your issue: I'm not sure what you are attempting to do can be done solely with mod_rewrite. My advice to you would be to check out the ModRewrite Forums (http://forum.modrewrite.com/). Pose your question there and I'm sure the website admin will be able to point you in the right direction.