Jump to:

23379 Posts in 18298 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » .htaccess File and SS Admin

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

Page: 1
Go to End
Author Topic: 1299 Views
  • Yellow7 Jon
    Avatar
    Community Member
    39 Posts

    .htaccess File and SS Admin Link to this post

    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.

  • ampedup
    Avatar
    Community Member
    133 Posts

    Re: .htaccess File and SS Admin Link to this post

    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,

  • Yellow7 Jon
    Avatar
    Community Member
    39 Posts

    Re: .htaccess File and SS Admin Link to this post

    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...

    1299 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.