No announcement yet.

.htaccess and custom 404

  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] .htaccess and custom 404

    Using the VB supplied .htaccess files seems to be all working fine and dandy.... except...

    when I test my 404 response I get a 500 Internal Server error. I've tried searching for solutions to this issue on this site, google and and no cigar.

    I created my own custom VB page here http:/

    but if you put something like

    it just fails with an error, and not even a 404, but a 500 Internal error?

    Before anyone says anything, I've also tried putting ErrorDocument 404 /forums/404nf.php into my .htaccess file and it still spazzes out.

    VB guys care to point out "you're doing it wrong"?

  • #2
    We'd need to know the cause of the internal server error before we can trouble shoot it.


    • #3
      You can see the error for yourself...

      This is the original unmodified vbulletin .htaccess file I am using:

      RewriteEngine on
      # This file is only needed if you have set the CMS URL in your admincp and you are 
      # using the mod_rewrite option for friendly urls.  If this is the case, copy this file
      # to your cms stub directory.
      # If you are having problems or are using Vi
      # RewriteBase /cms-stub-directory/
      # If you are having problems with the rewrite from content/ to content.php, uncomment this line to turn MultiViews off.
      # Options -MultiViews
      RewriteCond %{REQUEST_FILENAME} -s [OR]
      RewriteCond %{REQUEST_FILENAME} -l [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^.*$ - [NC,L]rtualDocumentRoot, uncomment this line and set it to your vBulletin directory.
      # MVC
      RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]
      If I delete the line

      # MVC
      RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]
      then inserting the error document line works. So it's clearly the .htaccess that is not compatible with the standard ErrorDocument directive.

      The error I get is: see attached fileClick image for larger version

Name:	Untitled.jpg
Views:	1
Size:	23.6 KB
ID:	3681838
      Last edited by downloadsUK; Wed 6 Apr '11, 10:00am. Reason: attach an image


      • #4
        We need the REAL error message that is causing the internal server error, contact your webhost for more help with this.


        • #5
          I'm trying to get at the error logs - they are not readily available under cpanel - or this error 500 is not being recorded. However, it's indicative from the post above and the attachment that it cannot use the ErrorDocument directive properly - because it's not compatible with the current .htaccess. What say you?


          • #6
            Youneed to contact your webhost to get the real errror message, those interal server errors are only logged to apache itself, not specific sites.


            • #7
              This is a horrible hash, but I've managed to fix it a little myself:

              #RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]
              RewriteRule ^(content)/(.*|$)$ $1.php?r=$2 [QSA]
              like I said, if you just examine the vbullletin rewrite rule you can see that's the one that allows the /content/1-my-article friendly URLS to work

              re-jigging it so it doesn't capture EVERY url and then try to rewrite which it can't and then spazzing out and 500 error I can force it to capture the right link from within the CMS,

              I have contacted my webhost and I am waiting on a reply. Hope this helps you help others in the future.

              I'll be back. With my error logs. Heh.


              • #8
                So I'm back here with some error loggage. Please take a look at this from my hosting:

                [Thu Apr 07 11:12:52 2011] [error] [client] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary.
                [Thu Apr 07 11:12:52 2011] [error] [client] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.


                • #9
                  You need to follow the advice given:

                  Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary.
                  Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                  Change CKEditor Colors to Match Style (for 4.1.4 and above)

                  Steve Machol Photography

                  Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                  • #10
                    So it would just error after 20 redirects rather than 10? That doesn't exactly address the problem....


                    Related Topics