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 File and SS Admin


Go to End


3 Posts   2278 Views

Avatar
Yellow7 Jon

Community Member, 39 Posts

30 April 2010 at 12:01pm

Alright, I know its kind of a weird thing to do, but...

I developed a site in a sub folder, and instead of moving all of the files into the root folder, we have set up the .htaccess file to hide the sub folder...

actual: http://www.example.com/new_site/SS_PAGE
perceived: http://www.example.com/SS_PAGE

now the site works as it should and what not, until I goto /admin and get redirected to example.com/Security/Login. I enter the admin details, and get redirected back to the login screen. For some reason I can NOT get into the admin...

heres my htaccess file.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /new_site/
RewriteRule index\.htm http://www.example.com/ [r=301,L,NC]

#Direct to Silverstripe
RewriteCond %{REQUEST_URI} ^(.*)$
#RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_URI} !/(themes|assets|jsparty|blog|pdf|images)
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L,NC]

#Do not direct to Silverstripe
RewriteCond %{REQUEST_URI} /(themes|assets|jsparty|blog|sapphire)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) $1 [L,NC]

</IfModule> 

any help would be greatly appreciated.

Avatar
3dgoo

Community Member, 135 Posts

30 April 2010 at 2:16pm

After entering the admin details, and getting redirected back to the login screen, if you then go to /admin do you get into the admin section?

I'm curious, why do you want to keep the site in the subfolder?

Cheers,

Avatar
Yellow7 Jon

Community Member, 39 Posts

30 April 2010 at 5:14pm

We're keeping it in the sub folder to allow both the old files and new site to be accessed.

and nope, cant get to the admin section at all, and when I hack away at the htaccess file enough, and get to the "admin" section I get an error saying its not a valid authenticator or something...