Announcement

Collapse
No announcement yet.

.htaccess and custom 404

Collapse
X
 
  • 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 vbulletin.org and no cigar.

    I created my own custom VB page here http:/www.download.co.uk/forums/404nf.php

    but if you put something like http://www.download.co.uk/thisisclearlygoingto404

    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.

    Comment


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

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

      Code:
      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

      Code:
      # 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 6th Apr '11, 10:00am. Reason: attach an image

      Comment


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

        Comment


        • #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?

          Comment


          • #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.

            Comment


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

              Code:
              #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.

              Comment


              • #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 178.32.59.13] 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 178.32.59.13] 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.
                Thoughts?

                Comment


                • #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.


                  Comment


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

                    Comment

                    Related Topics

                    Collapse

                    Working...
                    X