Current location: Hot Scripts Forums » Programming Languages » PHP » htaccess and mod_rewrite


htaccess and mod_rewrite

Reply
  #1 (permalink)  
Old 02-23-05, 06:29 PM
kjmatthews kjmatthews is offline
Wannabe Coder
 
Join Date: Jun 2004
Location: Boston, MA
Posts: 134
Thanks: 0
Thanked 0 Times in 0 Posts
htaccess and mod_rewrite

Having read a couple tutorials I thought I would be prepared to jump into this, but clearly I was not. Can someone please tell me what is wrong with these rewrite rules?

I have files that take the form http://.../logue/?postid=00001

and would like them to take the form http://.../logue/00001/

so my rewrite rule would:

RewriteRule ^/logue/([0-9]{5})/$ /logue/\?postid=$1

or possibly the other way around. I cannot seem to determine whether mod_rewrite rewrites the requested url (/logue/00001/) internally to then serve the correct page (as above), or what. Clarification in that respect would also be extraordinarily helpful. Thanks to all.
Reply With Quote
  #2 (permalink)  
Old 02-25-05, 08:36 AM
ArksI's Avatar
ArksI ArksI is offline
Newbie Coder
 
Join Date: Mar 2004
Location: Bulgaria
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
y u need /\?postid ???

try this out:
RewriteRule ^logue/([0-9]{5})/$ /logue/postid=$1 [L]

the [L] can be omitted, but it's better to have it
Reply With Quote
  #3 (permalink)  
Old 02-25-05, 02:33 PM
kjmatthews kjmatthews is offline
Wannabe Coder
 
Join Date: Jun 2004
Location: Boston, MA
Posts: 134
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
y u need /\?postid ???
For some reason I thought the forward slash had to be escaped. Apparently not. I will try this - thanks for the response!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 05:33 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.