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.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
mod_rewrite & .htaccess is confusing me
Old 04-30-2009, 07:41 AM mod_rewrite & .htaccess is confusing me
Junior Talker

Posts: 1
Trades: 0
Hi, I am trying to get site.com/variable to rewrite to site.com/index.php?id=variable

This is the code I have that is working
Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^id/([^/]+)/?$ index.php?id=$1 [L]
But this doesn't work with the id folder removed:
Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^([^/]+)/?$ index.php?id=$1 [L]
What am I doing wrong? Also, I noticed that you can put as many forward slashes in the url and it still rewrites, I don't want this to happen.

site.com/id////variable//// -------> site.com/index.php?id=variable

If anyone could give me a couple of pointers that would be great!
Thanks

Last edited by todorov; 04-30-2009 at 07:42 AM..
todorov is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to mod_rewrite & .htaccess is confusing me
 

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.09731 seconds with 12 queries