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

Admin Login Refreshes, Does Not Redirect


Go to End


6 Posts   1349 Views

Avatar
jdstafford

Community Member, 3 Posts

14 April 2015 at 8:13am

I have a Silverstripe install that was migrated to a subdirectory of an existing WordPress site in production. Everything seems to check out aside from a few warnings:

`Warning at framework/view/SSViewer.php line 786: None of these templates can be found in theme` .. etc
`Warning: Director::protocolAndHost() lacks sufficient information - HTTP_HOST not set.`
`Warning at framework/view/SSViewer.php line 1074: file_get_contents(): Filename cannot be empty`

The issue I'm having is when trying to login to the Admin section. I enter my username and password and submit, then the login form refreshes but nothing happens. No errors, no authentication, no redirect. Nothing. If anyone has some insight they can provide, it would be immensely appreciated.

Avatar
helenclarko

Community Member, 166 Posts

14 April 2015 at 9:05am

Edited: 14/04/2015 9:10am

Hi Jdstafford,

I would check your .htaccess redirects. It looks as though silverstripe cant find your templates for the security pages.
set your .htaccess redirect for one folder back (not the root folder) and you should be good to go.

-helenclarko

EDIT: Add this to your .htaccess file (Swap out \newsite with your directory name):

RewriteBase \newsite

Avatar
jdstafford

Community Member, 3 Posts

15 April 2015 at 1:38am

Hi helenclarko,

Thanks for your reply. I do in fact have a rewritebase rule in .htaccess for my silverstripe directory. Here is the rewrite portion:

<IfModule mod_rewrite.c>
        SetEnv HTTP_MOD_REWRITE On
        RewriteEngine On
        RewriteBase /podcastprimer/

        # Enable HTTP Basic authentication workaround for PHP running in CGI mode
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

        # Deny access to potentially sensitive files and folders
        RewriteRule ^vendor(/|$) - [F,L,NC]
        RewriteRule silverstripe-cache(/|$) - [F,L,NC]
        RewriteRule composer\.(json|lock) - [F,L,NC]

        # Process through SilverStripe if no file with the requested name exists.
        # Pass through the original path as a query parameter, and retain the existing parameters.
        RewriteCond %{REQUEST_URI} ^(.*)$
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule .* framework/main.php?url=%1 [QSA]

        # If framework isn't in a subdirectory, rewrite to installer
        RewriteCond %{REQUEST_URI} ^(.*)/framework/main.php$
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule . %1/install.php? [R,L]
</IfModule>

I also added this line to the WordPress (parent directory) .htaccess (in attempts to ignore the SilverStripe directory, although the subdirectory .htaccess should override the parent, in theory):

RewriteCond %{REQUEST_URI} !^/podcastprimer/ [NC]

Avatar
helenclarko

Community Member, 166 Posts

15 April 2015 at 8:56am

Hi Jdstafford,

I dunno if this is important, but quotations have been left out of the RewriteBase

Try this:

RewriteBase '/podcastprimer'

Avatar
jdstafford

Community Member, 3 Posts

27 April 2015 at 12:47am

I ended up moving this entire site to it's own top-level domain and sorted out the .htaccess rewrites. Now everything about the site appears just fine, with the exception of logging in. I am still redirected back to the login form without any error message. I tried adding a default admin to my _config.php, and even manually changing the password in MySQL and removing encryption- neither of these had any affect on the problem. Out of frustration and curiosity, I did a fresh install of SS on the production server and it has the same issue!

Avatar
ron.nguyen

Community Member, 1 Post

23 October 2016 at 7:04pm

This is quite an old post however, I am having this exact same issue and was wondering if anyone has any solution to this matter?

I have tried all the suggestions listed on this post and nothing seems to work. The page just keeps refreshing every time I log in however, hosting the site locally seems to login just fine.

Any thoughts?