Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 18th Nov 2009, 10:52 AM   #1
Dan Neece
War Room Member
 
danmart's Avatar
 
Join Date: 2008
Location: Phoenix,Arizona, USA.
Posts: 73
Thanks: 8
Thanked 8 Times in 8 Posts
Default
httaccess question
Share on: 
fb share twitter share gplus share more share

is there a way to pass two variables thrugh a httaccess rdirect? I want to do something like somesite.com/go/1003/somethingelse to translate to go.php?var1=1003&var2=somethingelse.
If there is no /1003/ then var1 would = blank...

Anyone know how to do this?

Dan
danmart is offline  
Unread 19th Nov 2009, 02:38 AM   #2
JROX.COM
War Room Member
 
Ryan Roxas's Avatar
 
Join Date: 2003
Location: Las Vegas, NV
Posts: 10
Thanks: 0
Thanked 1 Time in 1 Post
Blog Entries: 1
Default
Re: httaccess question
Share on: 
fb share twitter share gplus share more share

you should be able to do that with mod_rewrite:

Start Rewriting : mod_rewrite tutorial

JROX.COM Affiliate Manager - Affordable Affiliate Marketing Software
Ryan Roxas is offline  
Unread 19th Nov 2009, 08:19 PM   #3
Warrior Member
 
Join Date: 2009
Posts: 6
Thanks: 0
Thanked 2 Times in 2 Posts
Default
Re: httaccess question
Share on: 
fb share twitter share gplus share more share

Try:

Code:
<IfModule mod_rewrite.c>
    # Sets User Groups and Login URL
    Options +FollowSymlinks All -Indexes
    RewriteEngine On
    RewriteBase /

    # Causes every request to run through your-script.php
    RewriteRule (.*)$ your-script.php?%{QUERY_STRING} [L]
</IfModule>
in your php check out the array $_SERVER
SecureWeb is offline  
Unread 19th Nov 2009, 08:42 PM   #4
PHP Programmer
War Room Member
 
m4rx's Avatar
 
Join Date: 2009
Location: /dev/null
Posts: 138
Thanks: 6
Thanked 12 Times in 12 Posts
Default
Re: httaccess question
Share on: 
fb share twitter share gplus share more share

If you want a wonderful tutorial on mod_rewrite, you need to see .htaccess tricks and tips.. part two: url rewriting with mod rewrite.

Learned alot from this guy, and I know you will learn alot too.

--m4rx

We are what we repeatedly do. Excellence, then, is not an act, but a HABIT. ~Aristotle
Bored. Learn everything you need to know about Organic Gardening.
m4rx is offline  
Closed Thread


Bookmarks

Tags
httaccess, question


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




All times are GMT -6. The time now is 01:07 PM.