Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2008
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Any Char on HTACCESS?

    Hey there,

    how can i define *any char* on htaccess?

    i already have a shortcut (working) that the rule is:

    www.mydomain.com/192 ---------> www.mydomain.com/product.php?id=192

    i would like to do:
    http://www.mydomain.com/192/What_eve...nd_other_stuff --------> www.mydomain.com/product.php?id=192

    possible?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,854
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    try
    Code:
    RewriteRule ^([^/\.]+)$ /product.php?id=$1 [L]
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Jun 2008
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Nope

    Doesnt work,

    like i told you, i already know how to do
    www.mydomain.com/123 ---> www.mydomain.com/product.php?id=123

    for SEO reasons, i want to do
    http://www.mydomain.com/123/whatever...luding-(-and-- to redirect to www.mydomain.com/product.php?id=123

    that means it should only use the given number (ID) between the 2 '/'.

    how can i do that? ;/

  • #4
    New Coder
    Join Date
    Jun 2008
    Location
    Belgrade
    Posts
    19
    Thanks
    17
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by LiorBroshi View Post
    Doesnt work,

    like i told you, i already know how to do
    www.mydomain.com/123 ---> www.mydomain.com/product.php?id=123

    for SEO reasons, i want to do
    http://www.mydomain.com/123/whatever...luding-(-and-- to redirect to www.mydomain.com/product.php?id=123

    that means it should only use the given number (ID) between the 2 '/'.

    how can i do that? ;/
    Code:
    RewriteRule  ^([0-9]+)/(.*)$ product.php?id=$1
    Last edited by okram666; 07-07-2008 at 07:27 PM.


  •  

    Posting Permissions

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