Jump to:

23480 Posts in 18951 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » How to recieve a new .htaccess file...deleted mine on accident

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: 1475 Views
  • jasonthkim
    Avatar
    Community Member
    3 Posts

    How to recieve a new .htaccess file...deleted mine on accident Link to this post

    Much like the title of the thread says. I accidentally deleted this file and was wondering if anyone could chime in and help me replace this file. I have been searching and havent found anything related to replacing this if it was accidentally deleted.

    Thanks!

  • bartvanirsel
    Avatar
    Community Member
    94 Posts

    Re: How to recieve a new .htaccess file...deleted mine on accident Link to this post

    You could do a reintall and get it generated.

    Here is the (normal) content:

    ### SILVERSTRIPE START ###
    <Files *.ss>
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
    </Files>

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /silverstripe

    RewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)

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

    Of course RewriteBase /silverstripe has to be replaced by the place your install is.

  • jasonthkim
    Avatar
    Community Member
    3 Posts

    Re: How to recieve a new .htaccess file...deleted mine on accident Link to this post

    How would I go about reinstalling silverstripe?

    I used the installer offered from my webhosting company godadddy.com

  • bartvanirsel
    Avatar
    Community Member
    94 Posts

    Re: How to recieve a new .htaccess file...deleted mine on accident Link to this post

    Then you should use the code i put above and save it in the .htaccess file and put it on your server.

    Probably you need to use

    RewriteBase /

    instead of

    RewriteBase /silverstripe

  • jasonthkim
    Avatar
    Community Member
    3 Posts

    Re: How to recieve a new .htaccess file...deleted mine on accident Link to this post

    Bart,

    Thank you! You just saved me a whole lot of grief. I was afraid I would have to reinstall everything again!

    I guess this is what happens when newbies go out making their own websites.

    Jason

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