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.

General Questions /

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

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

htaccess and subdomain problems


Reply


8 Posts   5830 Views

Avatar
Drachenwinter

Community Member, 8 Posts

3 May 2010 at 4:36am

hello!

i'm a bit new to programing and silverstripe, and i have now some nasty problem with my current installation:

i installed silverstripe to root and have a subdomain in root/folder/

now, first my subdomain wasn't working. i asked around a bit and took the rewriterule line out of the htaccess file. that seemed to solve the problem at first, i could access the subdomain now. but later i found out that my primary domain isn't working anymore, i get the 403 Forbidden site

i looked through the forum and tried every given advice i found, but nothing seems to work.

i added RewriteCond %{REQUEST_FILENAME} !-d without anything more than that my subdomain still works.

if i leave it, both pages give me the 500 internal server error page.

as i only changed the htaccess it has to be the problem, so i would really appreciate any advice or solution as i really need both pages running =)

thanks in advance!

PS: if there is yet a topic referring to this problem i haven't found, please link!

Avatar
lerni

Community Member, 80 Posts

3 May 2010 at 5:27am

Edited: 03/05/2010 5:39am

http://www.silverstripe.org/installing-silverstripe/show/280505#post280505

http://www.ssbits.com/using-other-systems-together-with-silverstripe/

Avatar
Drachenwinter

Community Member, 8 Posts

3 May 2010 at 5:59am

Edited: 03/05/2010 5:59am

hm, none of those two solved my problem =/ now i again have both sites with 500... thanks anyway =)

Avatar
woodb2

Community Member, 48 Posts

3 May 2010 at 6:22am

I have several nested sites running inside my silverstirpe installation. I just add these two lines to the .htaccess file after the RewriteBase line:

RewriteRule ^subfolder$ subfolder/ [R,L]
RewriteRule ^subfolder/(.*)$ subfolder/$1 [L]

Avatar
banal

Community Member, 901 Posts

3 May 2010 at 9:11am

Edited: 03/05/2010 9:12am

I prefer to create a separate .htaccess for the subdomain. That's usually the cleanest way to solve the problem, because you don't have to put RewriteRules for a subdomain into the SilverStripe rewrite rules.

If you don't need url-rewriting for your subdomain, just put an .htaccess with the following content into your subdomain folder:

RewriteEngine Off

... and revert your .htaccess for your main site to the SilverStripe default rewrite rules.

Avatar
Drachenwinter

Community Member, 8 Posts

6 May 2010 at 7:58am

yeah, the last one did it =)

thank you very much!

Avatar
WebSpilka

Community Member, 83 Posts

15 March 2011 at 4:49am

Edited: 16/03/2011 8:34pm

I have the same problem as Drachenvinter
My SilverStripe CMS on http://split.lviv.ua/ plased on /home/split/public_html/split/
and subdomain http://forum.split.lviv.ua/ with phpBB forum (CPanel plase it on /home/split/public_html/split/forum/)

when I go to
[url]http://forum.split.lviv.ua/index.php[/url] or [url]http://split.lviv.ua/forum/[/url]- Forum work good

when i go to
[url]http://forum.split.lviv.ua/[/url] - forum not work
I have

500 Internal Server Error

And RewriteEngine Off
in subdomain
not work for me ((

Avatar
WebSpilka

Community Member, 83 Posts

16 March 2011 at 8:33pm

solution to my problem was
after adding the following lines in .htaccess silverstripe site [url=http://split.lviv.ua/]Split[/url]

   RewriteCond %{REQUEST_URI} !^/forum/.*
   RewriteCond %{HTTP_HOST} !^forum\.split\.lviv\.ua
   RewriteCond %{HTTP_HOST} !^www\.forum\.split\.lviv\.ua


forum [url=http://forum.split.lviv.ua/]Split forum[/url] started to work correctly