domain.com/abc works but domain.com/abc/ gives Error 500

Discussion in 'Programming' started by VolkanSEO, Jun 12, 2012.

  1. #1
    Hey Guys.
    I am working on optimizing a website and trying to create a better link structure for my client.
    However I have a problem

    http://www.aieus.com/faq works perfect.
    http://www.aieus.com/faq/ gives me 500 internal server error.

    here is my .htaccess code. please inform me if i did something wrong or missing something

    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    rewritecond %{http_host} ^aieus\.com [nc]
    rewriterule ^(.*)$ http://www.aieus.com/$1 [r=301,nc]


    #Fix Rewrite
    Options -Multiviews


    ## EXTENSION REWRITE HIDE PHP#
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^(.*)$ $1.php [L,QSA]


    ## Errors ##
    ErrorDocument 404 /404.php
     
    VolkanSEO, Jun 12, 2012 IP
  2. JerryRogers

    JerryRogers Member

    Messages:
    100
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #2
    Look inside your settings, it might have to do with canonical URLs or something
     
    JerryRogers, Jun 12, 2012 IP
  3. ssmm987

    ssmm987 Member

    Messages:
    180
    Likes Received:
    4
    Best Answers:
    3
    Trophy Points:
    43
    #3
    Adding this should fix it.
    
    RewriteRule ^(.*)/(.*)$ $1.php [L,QSA]
    
    Code (markup):
    Tbh I don't really know how it works with RewriteConditions. Guess you've got to find that out by yourself
     
    ssmm987, Jun 13, 2012 IP
  4. VolkanSEO

    VolkanSEO Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4

    Hey, this has given me the visa versa effect.

    d.com/abc/ worked fine and I got 404 for d.com/abc

    have any other idea?
     
    VolkanSEO, Jun 13, 2012 IP
  5. ssmm987

    ssmm987 Member

    Messages:
    180
    Likes Received:
    4
    Best Answers:
    3
    Trophy Points:
    43
    #5
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^(.*[^/])$ $1.php [L,QSA]
    RewriteRule ^(.*)/(.*)$ $1.php [L,QSA]
    
    Code (markup):
    Works for me.
     
    ssmm987, Jun 13, 2012 IP
  6. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #6
    And if none of that helps, post the error log entry here.
     
    Rukbat, Jun 16, 2012 IP