.htaccess

Discussion in 'Programming' started by Plutonic, Dec 22, 2010.

  1. #1
    I had some .htaccess problems with my site, so I deleted then reuploaded it and it ran okay. The problem is, now just about every second page I load within my site doesn't load (404) so then I refresh and it loads. Would that be a .htaccess problem?

    Here's the .htaccess, let me know if you notice any problems.

    Thanks.
     
    Plutonic, Dec 22, 2010 IP
  2. shofstetter

    shofstetter Well-Known Member

    Messages:
    178
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    120
    #2
    No I believe that would be a browser cache problem. Have you viewed your site from another computer? Have you cleared your browser cache?
     
    shofstetter, Dec 22, 2010 IP
  3. part3_studios

    part3_studios Peon

    Messages:
    49
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If it was a htaccess problem, you would have the exact same result for every page refresh, a 500 error or something.
    So it's either a browser cache problem, or a script problem.
     
    part3_studios, Dec 25, 2010 IP
  4. Cozmic

    Cozmic Member

    Messages:
    146
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    48
    #4
    FYI, if you're using htaccess you shouldn't have question marks in the URL. That tells google it's a dynamic page, stuff effecting the SEO of your page. It's best to end them with .html and not use punctuation like that.

    And I suggest you talk to the administrator of your server about this.
     
    Cozmic, Dec 25, 2010 IP
  5. part3_studios

    part3_studios Peon

    Messages:
    49
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Ah, I didn't notice that question mark.
    In that case, OP should escape the question marks with "\", as the question mark is a kind of regex wildcard.
    So, try:
    RewriteEngine On
    RewriteRule ^/admin /admin [L]
    RewriteRule ^/\?watch/([a-z0-9-/]+)$ index.php?menu=watchmovie&perma=$1 [L]
    RewriteRule ^/\?([a-z0-9-/]+)\.html$ index.php?menu=$1 [L]
    RewriteRule ^/\?pages/([a-z0-9-/]+) index.php?menu=page&permalink=$1 [L]
    RewriteRule ^/\?movies index.php?menu=movies [L]
    RewriteRule ^/\?tv-shows index.php?menu=tv-shows [L]
    RewriteRule ^/\?home index.php?menu=home [L]
    RewriteRule ^/\?([a-zA-Z0-9-]+)/season/([0-9]+)/episode/([0-9]+)$ index.php?menu=episode&perma=$1&season=$2&episode=$3 [L]
    RewriteRule ^/\?([a-zA-Z0-9-]+)/season/([0-9]+)$ index.php?menu=show&perma=$1&season=$2 [L]
    RewriteRule ^/\?([a-zA-Z0-9-]+)$ index.php?menu=show&perma=$1 [L]
    
    Code (markup):
     
    part3_studios, Dec 25, 2010 IP