PHP doesn`t execute after mod rewrite

Discussion in 'PHP' started by tzau, Oct 9, 2009.

  1. #1
    Hi,

    I've done mod rewrite on my site so now it`s site.com/dir/ instead of site.com/dir.php

    But the problem is that when I visit site using /dir/ it doesn`t execute video properly, but when I visit site via /dir.php it works normally. But both links uses same php file as first is just rewrited in .htaccess
     
    tzau, Oct 9, 2009 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    can you paste the code?
     
    JAY6390, Oct 9, 2009 IP
  3. tzau

    tzau Well-Known Member

    Messages:
    522
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #3
    <a  href="/videos/fat-loss-4-idiots.php?keepThis=true&TB_iframe=true&height=450&width=450">Video</a>
    Code (markup):
    When visiting site.com/file.php and click on Video it bumps video, but when I visit site.com/file/ and click Video, it just gets me to another page "fat-loss-4-idiots.php?keepThis=true&TB_iframe=true&height=450&width=450" where is that video.

    I just want it bump as it does when visiting site.com/file.php

    Any idea?


    Thanks
     
    tzau, Oct 9, 2009 IP
  4. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #4
    lol I mean the htaccess code
     
    JAY6390, Oct 10, 2009 IP
  5. tzau

    tzau Well-Known Member

    Messages:
    522
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #5
    oh, sorry, I've misunderstand.

    .htaccess code is:

    Options +FollowSymLinks
    
    RewriteEngine On
    
    RewriteRule ^([^.]+)/$ /$1.php [QSA,L]
    
    Code (markup):
     
    tzau, Oct 10, 2009 IP
  6. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #6
    RewriteRule ^([.]+)/$ /$1.php [QSA,L]
     
    JAY6390, Oct 10, 2009 IP
  7. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #7
    change your link to this

    <a href="http://www.yourdomain.com/videos/fat-loss-4-idiots.php?keepThis=true&TB_iframe=true&height=450&width=450">Video</a>

    change yourdomain.com to your domain name
     
    Bohra, Oct 10, 2009 IP
  8. tzau

    tzau Well-Known Member

    Messages:
    522
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #8
    JAY6390, rewrite doesn`t work your way..

    @Bohra: it doesn`t make any difference..


    Still looking for solutions
     
    tzau, Oct 11, 2009 IP
  9. chadsmith

    chadsmith Peon

    Messages:
    82
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #9
    It won't work because the rule says to only redirect URLs like video/ & file/ to video.php & file.php and this URL doesn't end with /.

    What's the real URL it needs to go to?
     
    chadsmith, Oct 11, 2009 IP
  10. tzau

    tzau Well-Known Member

    Messages:
    522
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #10
    Thanks for support everyone, but I decided to let my site in "site.com/page.php" way. I think it`s also good for SEO as long as it isnt like site.php?id=3453 ...and much easier to just let it as it is.
     
    tzau, Oct 11, 2009 IP