Any ideas? If you need any more information, please ask me.
folder/892384 instead of folder/?892384 or folder/?id=892384
Moderator: General Moderators
folder/892384 instead of folder/?892384 or folder/?id=892384
I'm making a small, custom-built forum for my website. I want each thread to have a real address, or atleast look like it is. I know how to do the ?892384 and ?id=892384 (who doesn't
). But, I want it to have a folder/892384, but not have to create that file each and every time a post is posted.
Any ideas? If you need any more information, please ask me.
Any ideas? If you need any more information, please ask me.
i.e.any request on /php will be handled through php.
Having a php-script file forum in that directory a request for http://your.host/board/forum/892384 will result indon't know wether this is clean or not - but it works 
Code: Select all
<Location /board>
SetHandler application/x-httpd-php
Order allow,deny
Allow from all
</Location>Having a php-script file forum in that directory a request for http://your.host/board/forum/892384 will result in
Code: Select all
$_SERVERї'SCRIPT_NAME'] == '/board/forum'
$_SERVERї'PATH_INFO'] == '/892384'- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
Yes, you would be using htaccess simlar to php.net to tell your server
"if a real file is not found, and it's an integer, search for the # post"
look at the bottom of http://www.php.net/urlhowto.php
"if a real file is not found, and it's an integer, search for the # post"
look at the bottom of http://www.php.net/urlhowto.php
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
i do something similar to this on my forums. my requested uri's look like this:
then i use Apache's Rewrite Module to translate this to a page. here is what my conditions look like
so the above uri translates to this:
then in the first line of thread.php I have this
at that point i have my thread id and can use it as i wish. hope this helps and would be willing to help you more in getting your application to work.
Code: Select all
/forum/thread/######Code: Select all
RewriteRule ^forum/thread/(ї0-9]+) /forum/thread.php?$1Code: Select all
/forum/thread.php?######Code: Select all
$tid = $_SERVERї'argv']ї0];