SEO link in .htaccess .... don' t work ..

Discussion in 'Apache' started by icoman, Jul 17, 2008.

  1. #1
    Hi all,
    I am trying to make seo link from actual link:

    www.site.com/litoral.php?1 to litoral/1 or litoral=1

    i've tried:
    RewriteRule ^litoral/([0-9]+)/?$ litoral.php?([0-9])([0-9])/$1 [L]
     
    icoman, Jul 17, 2008 IP
  2. pr0t0n

    pr0t0n Well-Known Member

    Messages:
    243
    Likes Received:
    10
    Best Answers:
    10
    Trophy Points:
    128
    #2
    Your rule doesn't seem correct to me... It should be something like this:

    
    RewriteEngine On
    RewriteBase /
    
    RewriteRule ^litoral/([0-9]+)/$ /litoral.php?$1 [L]
    RewriteRule ^litoral/([0-9]+)$ /litoral.php?$1 [L]
    
    Code (markup):
    Both rules are practically the same, one just ends with / and one without it (to make it work for you with both litoral/1 and litoral/1/ )
     
    pr0t0n, Jul 17, 2008 IP
  3. icoman

    icoman Peon

    Messages:
    9
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    my .htaccess:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^(.*)\.htm$ $1.php [nc] [L]
    RewriteRule ^litoral/([0-9]+)/$ /litoral.php?$1 [L]

    now it not work rewrite php to htm ... I mean if i request a file aaa.htm the server say:
    The requested URL /aaa.php was not found on this server.
    if i remove the line: RewriteBase / the above rewrite rule work (but last line don't do anything .. ).

    now if i let the code:

    Options +FollowSymlinks
    RewriteEngine on

    RewriteRule ^(.*)\.htm$ $1.php [nc] [L]
    RewriteRule ^litoral/([0-9]+)$ /litoral.php?$1 [L]
    The requested URL /litoral/1 was not found on this server.
    and that if i reqest litoral/1.

    please help ! (i've remove and [L] from RewriteRule ^(.*)\.htm$ $1.php [nc] [L] - line .. and the same)
     
    icoman, Jul 22, 2008 IP
  4. pr0t0n

    pr0t0n Well-Known Member

    Messages:
    243
    Likes Received:
    10
    Best Answers:
    10
    Trophy Points:
    128
    #4
    Hmmm... so do you actually have that aaa.php ? Is it in the main html folder, or in some sub folder?
     
    pr0t0n, Jul 23, 2008 IP
  5. icoman

    icoman Peon

    Messages:
    9
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    the file aaa.* is generic .. every file i try to load .. the result is the same ..
    the .htaccess file and all the files that i've write in these forum are in the same folder.
    http://localhost/arrow/ -- windows server that i use to test .. and then i will put on linux.

    need some help pls ..
     
    icoman, Jul 29, 2008 IP