htaccess is this possible?

Discussion in 'Apache' started by mob4u1, Oct 6, 2008.

  1. #1
    www.sitename.com/index.php?name=[B]JOHN.SMITH[/B]&document['details'].submit()
    Code (markup):
    this typed into my address bar works by filling out the field name and submiting the form also.

    i want someone to be able to type this instead:
    www.sitename.com/[B]JOHN.SMITH[/B]
    Code (markup):
    i have the following at the moment any ideas as just comes up with a server error:

    RewriteRule ^/?([a-z0-9]*)\.([a-z]*)$ /index.php?name=$1.$2&document['details'].submit() [L]
    Code (markup):
     
    If someone posts a solution, use the "Best Answer" link in their post to pick it as the best answer.
    mob4u1, Oct 6, 2008 IP
  2. mob4u1

    mob4u1 Guest

    Best Answers:
    0
    #2
    ANYONE?

    www.sitename.com/index.php?name=JOHN.SMITH&document.details.submit()
    Code (markup):
    to

    www.sitename.com/JOHN.SMITH
    Code (markup):
     
    mob4u1, Oct 8, 2008 Set Best Answer IP
  3. seismic2

    seismic2 Peon

    Messages:
    27
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    RewriteRule ^([^/\.]+)\.([^/\.]+)$ /index.php?name=$1.$2&document.details.submit() [R=301,L]
    Code (markup):
    Untested, but it should work.
     
    seismic2, Oct 8, 2008 Set Best Answer IP
  4. mob4u1

    mob4u1 Guest

    Best Answers:
    0
    #4
    thanks, but: still a server error
     
    mob4u1, Oct 8, 2008 Set Best Answer IP
  5. seismic2

    seismic2 Peon

    Messages:
    27
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This should work :
    RewriteCond %{QUERY_STRING} ^name=([^&]+)&document\.details\.submit\(\)$
    RewriteRule ^index\.php %1 [R=301,L]
    Code (markup):
     
    seismic2, Oct 11, 2008 Set Best Answer IP
  6. mob4u1

    mob4u1 Guest

    Best Answers:
    0
    #6
    nope, still no joy...
     
    mob4u1, Oct 15, 2008 Set Best Answer IP
  7. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #7
    The only trouble I could see with your original RewriteRule was that it didn't accept capital letters and the name you were using was entirely in capital letters.

    You could either do this:
    RewriteRule ^/?([a-z0-9]*)\.([a-z]*)$ /index.php?name=$1.$2&document['details'].submit() [NC,L]
    Code (markup):
    or this:
    RewriteRule ^/?([a-zA-Z0-9]*)\.([a-zA-Z]*)$ /index.php?name=$1.$2&document['details'].submit() [L]
    Code (markup):
     
    Ladadadada, Oct 16, 2008 Set Best Answer IP
  8. mob4u1

    mob4u1 Guest

    Best Answers:
    0
    #8
    nope, anyone know of a htaccess generator site / prog?
     
    mob4u1, Oct 17, 2008 Set Best Answer IP
  9. Rian

    Rian Well-Known Member

    Messages:
    1,763
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    125
    #9
    Rian, Oct 17, 2008 Set Best Answer IP