How to turn ElggRewriteTester off

I wonder if somebody can tell me how to turn the rewritetester off?

I had done it once b3fore but for some strange reason i cannot seem to find the line or the site that showed me how to do it in the first place.

thanks in advance

regards

  • you'll have to grab the source code for the ElggRewriteTester class and find the method inside there -- which triggers the rewrite testing, most likely a protected function to run the tests and in there handle the status(es) appropriately to 'turn it off' ;-) that's all there is to it - it's really quite easy kid-stuff once you get to the class / method source code.. lolz ;-P

  • Why would it need to be turned off?

  • onny gawd knowz why duh 1/2 gweeks wanna do dat..! but there's duh answah! seek (~grep) and ye shall find.

  • @Stumpy  In case you really have a reason to turn this off, you need to do the following simple modification in <your Elgg website>/install/ElggRewriteTester.php:

    protected function runRewriteTest($url) {

            $this->serverSupportsRemoteRead = TRUE;

            if (function_exists('curl_init')) {
                // try curl if installed
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL, $url);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                curl_setopt($ch, CURLOPT_TIMEOUT, 10);
                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                $response = curl_exec($ch);
                curl_close($ch);
                //return $response === 'success';
                return TRUE;

            } else if (ini_get('allow_url_fopen')) {
                // use file_get_contents as fallback
                $response = file_get_contents($url);
                return $response === 'success';
            } else {
                $this->serverSupportsRemoteRead = FALSE;
                return FALSE;
            }
        }

  • You shouldn't turn off the rewrite test. It's there for a reason. If you think there is a bug in it, please provide details.

  • @cash & DhrupDeScoop & Matt Beckett thanks for the replies...

    My host runs Ubuntu server and they won't edit the conf file for secirity reasons. I can't remember the exact file but I did it on my own ubuntu server and it installed fine once I edited it (AllowOverride to All????) well they wouldn't do it and i did it on my own machine and viola! Soooooo....  I had no choice but to do it that way - when I hit 'test' I got "success" so all is well


    ps sorry for the REALLy late reply and thanks for the help all


    regards