Results 1 to 11 of 11

 

Thread: mod_rewrite - almost cracked!

  1. #1
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts


    getting to grips with this now after playing about, messing a lot of things up and reading a lot of old posts on here just one think I couldnt find.

    Normally I have a script and I send a load of things and it gives me a nice output such as:

    mysite.com/script.php?A=val1&B=val2&C=val3&D=val4

    how would I get that to work so that the url would be:

    mysite.com/folder/val1/val2/val3/val4

    currently in my mod_rewrite bit of the htaccess I have mastered getting it to cope with the first value which is all good so far, but how would I adapt this to take on more and work like shown above?

    RewriteRule ^folder/([a-zA-Z0-9_+]*).* script.php?A=$1

    Normally Id mess about on a server till I get it right, but dont have that luxuary right now so if you can help id appreciate it a lot. yes you
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  2. #2
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Posts
    2,448
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This should do it : -
    RewriteRule ^folder/([a-zA-Z0-9_+]*)/([a-zA-Z0-9_+]*)/([a-zA-Z0-9_+]*)/([a-zA-Z0-9_+]*) script.php?A=$1&B=$2&C=$3&D=$4
    You should see how to make it work for a different number of variables.

  3. #3
    ShagaaDaggaDoo

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Surrey
    Posts
    1,150
    Thanks
    0
    Thanked 9 Times in 6 Posts
    Try


    RewriteRule ^folder/([a-zA-Z0-9_+]*)/([a-zA-Z0-9_+]*)/([a-zA-Z0-9_+]*)/([a-zA-Z0-9_+]*)/.* script.php?A=$1&B=$2&C=$3&D=$4

  4. #4
    ShagaaDaggaDoo

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Surrey
    Posts
    1,150
    Thanks
    0
    Thanked 9 Times in 6 Posts
    eekk you beat me!

  5. #5
    ShagaaDaggaDoo

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Surrey
    Posts
    1,150
    Thanks
    0
    Thanked 9 Times in 6 Posts
    eekk you beat me!

  6. #6
    ShagaaDaggaDoo

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Surrey
    Posts
    1,150
    Thanks
    0
    Thanked 9 Times in 6 Posts
    eekk you beat me!

  7. #7
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    Thank you both, just like I thought

    well I wasn't far off with what I was thinking.

    Frostie as these two concur (concur, what word!) I dont think ill need that thar server you was offering, but thanks anyway
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  8. #8
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Posts
    2,448
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Eekk I beat Aquanuke - the world must be spinning backwards
    Anyway, our solutions were slightly different so one should sort the problem.

  9. #9
    Elaine's Avatar
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Redcar Cleveland North of Leeds
    Posts
    2,564
    Thanks
    120
    Thanked 86 Times in 62 Posts
    show offs!!
    Elaine - Children's Rooms, Allkids & Toddler Beds
    email: info @ childrens-rooms.co.uk
    01642 440110

    Parent Centre - Parenting Blog

  10. #10
    ShagaaDaggaDoo

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Surrey
    Posts
    1,150
    Thanks
    0
    Thanked 9 Times in 6 Posts
    funny i looked at this thread on another pc and there was an echo, dunno what happened.

  11. #11
    Elaine's Avatar
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Redcar Cleveland North of Leeds
    Posts
    2,564
    Thanks
    120
    Thanked 86 Times in 62 Posts
    Well I'm making headway anall - got the little grinning chappie in the right place - that's a first!! (not risking it again, though)
    Elaine - Children's Rooms, Allkids & Toddler Beds
    email: info @ childrens-rooms.co.uk
    01642 440110

    Parent Centre - Parenting Blog



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2