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

silverstripe clean URL on mamp


Reply

2 Posts   773 Views

Avatar
bunheng

28 December 2011 at 11:22pm Community Member, 78 Posts

Hi All,

I am having trouble running silverstripe on Mac OS using MAMP pro, I have been trying 3 hours to solve but impossible, every time I browse the site it ways appear with index.php/something in url, i thought it was from mod_rewrite but I could find where to fix it even in httpd.conf as well. The site and .httaccess working fine in XAMPP window environment. I really appreciated if you could point me where to fix it.

Regards,
Bunheng

Avatar
Tim Snadden

29 December 2011 at 8:39am (Last edited: 29 December 2011 8:40am), Community Member, 32 Posts

The only Silverstripe related thing I can think of would be to ensure that the following is in your mysite/_config.php.

SiteTree::enable_nested_urls();

Beyond that, it's really an Apache/MAMP issue so you may have some luck in the MAMP forum if you can't solve it now.

I'd temporarily eliminate Silverstripe from the equation and confirm that mod_rewrite is enabled and functioning correctly.
I'm not sure exactly how MAMP Pro does it, but the Apache configuration for MAMP is in /Applications/MAMP/conf/apache. The main configuration file is httpd.conf. Remember to restart the web server to load in any config changes.

You need to confirm that there is a line like this in httpd.conf.

LoadModule rewrite_module modules/mod_rewrite.so

You could also run the following in the terminal

/Applications/MAMP/Library/bin/httpd -M | grep rewrite


This should return

Syntax OK
rewrite_module (shared)

From memory MAMP Pro has a slightly funky way of setting up virtual hosts. Perhaps you could create a new virtual host without silverstripe and check the most basic mod_rewrite test you can create.

Another tool in your toolbox would be to log mod_rewrites activity by adding the following to httpd.conf (and restarting server)

RewriteLog /Applications/MAMP/logs/rewrite_log
RewriteLogLevel 1 #(Could be higher but this should be enough for now)

Look through your apache logs in /Applications/MAMP/logs and see if there are any clues there.

Good luck.