Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » mod_rewrite is enabled in your httpd.conf

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 2126 Views
  • Briohny
    Avatar
    Community Member
    199 Posts

    mod_rewrite is enabled in your httpd.conf Link to this post

    Hi,

    I have a site working perfectly on my localhost. Want to move it to a GoDaddy.com server.

    Have uploaded all my files but during installation, i'm getting a mod_rewrite error.


    Warning: file_get_contents(http://../InstallerTest/testrewrite) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/content/s/a/n/../html/rewritetest.php on line 47

    Warning: file_get_contents(http://../InstallerTest/testrewrite) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/content/s/a/n/../html/rewritetest.php on line 47

    mod_rewrite doesn't appear to be working. Make sure: mod_rewrite is enabled in your httpd.conf
    AllowOverride is enabled for the current path.

    How do i go about making mod_rewrite enabled? GoDaddy were about as useful as a hole in the head!

    I've read that i need to insert code into the .htaccess file such as

    RewriteEngine on

    but nothing seemed to happen. Can someone please help.

    Thanks

  • ptr
    Avatar
    Community Member
    5 Posts

    Re: mod_rewrite is enabled in your httpd.conf Link to this post

    Hi Briohny!

    Maybe it helps to define the RewriteBase in the .htaccess-file:

    RewriteBase /

    Cheers,
    Peter

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: mod_rewrite is enabled in your httpd.conf Link to this post

    Hi Briohny

    I had this same problem, the solution was to copy and paste the code below into the .htaccess:

    AddHandler x-httpd-php5 .php
    AddHandler x-httpd-php .php4
    RewriteEngine On

    ### SILVERSTRIPE START ###
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$

    RewriteCond %{REQUEST_URI} ^(.*)$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
    ### SILVERSTRIPE END ###

    I also had a page refresh problem on godaddy whereby when you refresh a page it can't find it, which can be fixed by commenting out line ~320 in the file /sapphire/core/HTTP.PHP

    // header(“Last-Modified: “ . self::gmt_date(self::$modification_date));

    This was all contained in a guide to installing SS on godaddy that was on an old blog but unfortunately that blog no longer exists, perhaps it would be good to get this information on the site somewhere?

    Aram

    2126 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.