Welcome to WebmasterWorld Guest from 22.214.171.124
Let's say my domain is mydom.com. I am a new user who just registered newsite as my name. I want to load a PHP file, but call it something other than - say - default.php. In other words, I want to load a pagedefault.php file which will pull information from a database based on the user's name. There are not going to be user directories. (The user will have no ability to upload using FTP.)
As I currently see it, I can do something like: [mydom.com...]
What I'd like to do is something like:
[mydom.com...] on the address bar of the browser. This will be parsed into the correct parameter (username=newsite) and the correct page (default.php) will be loaded. I noticed one semi-related item here from a bit ago..
This forum post describes the use of MOD_REWRITE.
make a file called .htaccess (nothing before the period)
RewriteRule (.*)/(.*).htm $2.php?username=$1
this will take
and send it to
as long as anything isn't the name of a directory
HOPE THIS HELPS
WhosAWhata is referring to the Apache Module mod_rewrite [httpd.apache.org]. You can read some about it there and there is also an Apache URL Rewriting Guide [httpd.apache.org] that may come in handy.
Lastly, for a quick start, there is a good document in the WebmasterWorld Apache Forum titled:
An Introduction to Redirecting URLs on an Apache Server: For mod_rewrite beginners [webmasterworld.com]
I kind of "flipped a coin" as to where to post.
You can see an early test here of me changing .html into php files using the .htaccess...
I'll see about how the suggestion worked.
[edited by: jatar_k at 11:04 pm (utc) on June 2, 2004]
[edit reason] no personal urls thanks [/edit]