Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

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

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

mod_rewrite is enabled in your httpd.conf


Reply


3 Posts   2176 Views

Avatar
Briohny

Community Member, 199 Posts

14 October 2008 at 12:46am

Edited: 14/10/2008 12:47am

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

Avatar
ptr

Community Member, 5 Posts

28 October 2008 at 3:26pm

Hi Briohny!

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

RewriteBase /

Cheers,
Peter

Avatar
Carbon Crayon

Community Member, 598 Posts

29 October 2008 at 3:56am

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