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.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

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

WAMP install -- mod-rewrite error


Go to End
Reply


10 Posts   4171 Views

Avatar
pjonathan

Community Member, 9 Posts

9 January 2010 at 11:26am

First off, thanks in advance for anyone helping me, I'm a first time user of SS and thought it was straightforward until I ran into this problem.

____
Friendly URLs are not working. This is most likely because mod_rewrite isn't configuredcorrectly on your site. Please check the following things in your Apache configuration; you may need to get your web host or server administrator to do this for you:
mod_rewrite is enabled
AllowOverride All is set for your directory
____

I've looked into countless of others who had the same issue, but nothing seems to do the trick.

My .htaccess file looks like this:

____
### SILVERSTRIPE START ###
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /beta

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]
</IfModule>
### SILVERSTRIPE END ###
_____

I'm using WAMP on 32-bit Win7, PHP 5.

Any advice would be GREATLY appreciated!

Avatar
OwenW

Community Member, 45 Posts

9 January 2010 at 2:43pm

Heya,

Your best bet issue is that the mod_rewrite module is not loaded in the apache at all.

Have a look in the apache configuration file and you will most likely find that the load module line for mod_rewrite is commented out like this

“#LoadModule rewrite_module modules/mod_rewrite.so”

Remove the hash, and restart apache and then you should be good to go.

Cheers

Owen

Avatar
pjonathan

Community Member, 9 Posts

10 January 2010 at 1:00pm

Thanks OwenW for your informative reply.

Unfortunately there was already no hash for that line in the apache config file.

What I am unsure about is (and bear with me, this is my first time using apache/php), should the apache files/folders be present in the remote host? They are presently only in the local host.

Perhaps this is the issue? Or something else?

If anyone has any ideas of what I could be looking out for, it could be something fundamental I'm overlooking here, or not.

Thanks,
Jonathan

Avatar
BigChris

Community Member, 63 Posts

12 January 2010 at 4:54am

If its WAMP Server 2, here is what you can do.

In the bottom corner of the Task Tray on Windows where your clock is, there should be a semi circle in white that is an icon.
Click on it and it should be the WAMP Menu. go to Apache - > Service and click on Stop Service.

Then go to Apache - > Apache Modules, slide the mouse down to the bottom so that it scrolls down and look for rewrite_module.
It is unlikely to be ticked. Now I had some problems here getting it to tick. So try it a few times.

Then restart Apache by going to Apache - > Service and click on Start/Resume Service.

This should start Apache with rewrite enabled.

That should help with your rewrite problems.

Chris

Avatar
pjonathan

Community Member, 9 Posts

12 January 2010 at 7:09am

Good tip BigChris but to no avail -- the rewrite_module is already checked off in my Apache Modules.

I'm suspecting perhaps the issue is that I did not install the SilverStripe to my root folder, but rather into a folder called 'beta'. Can anyone let me know if this is problematic?

I wouldn't mind restarting the process and putting it in the root, but I don't want the site to display until I've finalized a few things... is there a way to avoid the SilverStripe site being shown and having my under construction page there until I am ready?

Thanks to anyone has answers to these two questions, or has suggestions in solving the original problem (understanding why I'm getting a mod_rewrite / allowoverride error despite both being enabled).

Best,
Jonathan

Avatar
BigChris

Community Member, 63 Posts

12 January 2010 at 9:25am

The default folder that WAMP will look in is usualy C:\wamp\www\

You can put your files into that directory or a folder in it. If you choose a folder on that directory your web browser will look for localhost/foldername/ as the base url.

Alternatively you can edit the Apache Conf file so that the web document root is changed to be a directory of your choosing.
Go to Apache -> httpd.conf and edit it in a text editor.
Changed the directory of document root from
DocumentRoot "c:/wamp/www/" to whatever you want.

And changed also <Directory "c:/wamp/www/"> to your new directory.

Good luck
Chris

Avatar
pjonathan

Community Member, 9 Posts

12 January 2010 at 11:08am

Thanks, though I was aware of most of that. What is mostly needed is to set up my site so that the silverstripe index page runs out of www.mysite.com/subdirectory as opposed to www.mysite.com. Any way to do this?

Avatar
BigChris

Community Member, 63 Posts

13 January 2010 at 12:09am

To run it out of a subdirectory, create the directory and install silverstripe to that directory. Silverstripe should work fine from www.mysite.com/subdirectory

Go to Top