Jump to content

[SOLVED] using 404 file to direct requests... A better way?


Pyrozz

Recommended Posts

So the website I am working on displays information based on the url.

 

For starters, the sub domain determines the user name.

For example: pyrozz.mysite.com

The account "pyrozz" will be pulled from a database and information will be displayed. This is handled in the main index.php file.

 

The next part (which is where I have a question about) is the directory portion of it...

 

So now each user has imaginary directories within their account. Let's say pyrozz has "my_photos." So that would be pyrozz.mysite.com/my_photos.

Here's the thing, my_photos doesn't exist, nor do I want it to exist, I just want a php script to display information based on what it says.

 

So my solution is using the 404 file. In my error page (404.php) it looks at the URL and figures out what imaginary directory to display. Then it will use include etc... Whatever.

 

 

I guess that was an excessive explanation, but my question is, is there a better way to do this? Is there some way to have a script handle ALL URL requests?

 

I would edit instead reply, but I guess that feature isn't availabe in WAP browsing...

 

Well I did figure it out, as I suspected you can do this with  the .htaccess file with "rewrite engine"

 

...And how convinient that the rule set uses reg exp!! I just learned regexp syntax, so this is just awesome.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.