Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Closed Thread
Send a PHP variable to htaccess
Old 01-02-2011, 05:08 PM Send a PHP variable to htaccess
Physicsguy's Avatar
404 - Title not found

Posts: 920
Name: Scott Kaye
Location: Ontario
Trades: 0
How can I send a variable I've dynamically set in PHP to my htaccess file?

I'm making a forum, and instead of having /forum/thread/1.htm like I do now, I want to be able to fetch the post title and put that as the URL, so it would be /forum/thread/title-of-thread.htm like vBulletin.

I know it's possible, I've just messed around so much I can't get it. Here's what I have now. This is what gives you /forum/thread/1 (thread.php?threadID=1).

Code:
RewriteRule ^([0-9]+)(|.(htm(.*)|php|cgi|thread|post|topic))$ thread.php?threadID=$1
With a few added stuff, like /forum/thread/1.topic or 1.post. For those of you who don't get that, here.

Code:
RewriteRule ^(.*).html$ thread.php?threadID=$1
*Simplified

Any help it appreciated!

Thanks,

-PG
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
View Public Profile
 
 
Register now for full access!
Old 01-02-2011, 06:51 PM Re: Send a PHP variable to htaccess
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
How can I send a variable I've dynamically set in PHP to my htaccess file?
You can't! .htaccess is parsed before PHP even starts.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
View Public Profile Visit chrishirst's homepage!
 
Old 01-02-2011, 07:07 PM Re: Send a PHP variable to htaccess
Physicsguy's Avatar
404 - Title not found

Posts: 920
Name: Scott Kaye
Location: Ontario
Trades: 0
Ah, ok. Looks like I'll have to find another way around it :P
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
View Public Profile
 
Closed Thread     « Reply to Send a PHP variable to htaccess
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11660 seconds with 12 queries