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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

.htaccess configuration


Go to End


1187 Views

Avatar
bebabeba

Community Member, 193 Posts

14 September 2010 at 7:07pm

Hi!
I install subsite module but not working properly. I read some discussion and I find the following solution but doesn't work correctly. The instruction on my subsite's link seems to be ignored. The correct URL should be: httpl://my_server/test/nuovapage?SubsiteID=3.
In my .htaccess I wrote the following lines:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /test

# Subsite rewrite
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^subsite$
RewriteRule .* sapphire/main.php?url=%1&SubsiteID=3&%{QUERY_STRING} [L]

# Normal SilverStripe page
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>

and in my config apache I wrote:

<Directory "D:/test">
Options Indexes FollowSymLinks
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Alias /test "D:/test"
Alias /subsite.test "D:/test"

Can you help me to find correct instructions please?
Thanks!