SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    .htaccess hide question mark

    Hello sitepoint comunity,
    i have problem with .htaccess redirection.
    Here is a link in site :
    <a href="norma/neco1/neco2/neco3">LINK</a>

    Here is a .htaccess code :
    Code:
    RewriteEngine On
    RewriteBase /
    RewriteRule ^/?index.php / [R=301,L]
    
    RewriteRule ^norma/([^/]+)/([^/]+)/([\d\.]+) /index.php?norma-$1-$2-$3.html [NC,L]
    Link now look like :
    eshop.mydomain.com/?norma-something1-something2-something3.html

    And I am need look like this:
    eshop.mydomain.com/norma-something1-something2-something3.html


    Please help.
    Thank you in advance.
    ps. sorry for my bad english

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,644
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    m7,

    The ? is a reserved character in URIs. It specifically separates the {REQUEST_URI} string from the {QUERY_STRING} so your desired URL can never work. Please refer to http://www.ietf.org/rfc/rfc2396.txt for allowed characters.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Member
    Join Date
    Aug 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, thank you.
    Can you please tell me, how i can change htacces code for this situation ?
    I am need send /norma/something1/something2/something3 in link (<a href="/norma/something1/something2/something3">LINK</a>)
    And what i must make, if i need url http://eshop.mydomain.com/norma-some...ng2-something3

    Thank you in advance.

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,644
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    M7,

    If you create a link like that, you need to match norma/something1/something2/something3, capture those value and redirect them to ... where?

    You might benefit from reading the mod_rewrite tutorial linked in my signature as it contains explanations and sample code. It's helped may members and should help you, too.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Tags for this Thread

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
  •