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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Installing SilverStripe /

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

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

base url, subdirectory installation, htaccess problem


Go to End


4657 Views

Avatar
Stompit

Community Member, 17 Posts

16 July 2009 at 6:17pm

Edited: 16/07/2009 6:18pm

Hi There,
Have spent a couple of hours scanning the forums and trying out solutions with no luck. SilverStripe is installed in a sub-directory, now it is launch time, so I planned to just change the .htaccess file. This works, but the the site links still use the sub-directory in their urls.

Site is installed in /site09/

.htaccess in /site09/ folder is the following:
### SILVERSTRIPE START ###
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files>

<IfModule mod_rewrite.c>
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]
</IfModule>
### SILVERSTRIPE END ###

.htaccess file in root folder (public_html) is:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ site09/$1
</IfModule>

This worked on another server, but not in this instance.

Have also tried to force the base url in the /mysites/configuration file but this has knock on effects like not being able to log into the CMS admin.

Any help would be greatly appreciated! :)

Thanks
Duncan