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

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


Go to End


5 Posts   2806 Views

Avatar
jasonthkim

Community Member, 3 Posts

18 March 2010 at 8:35am

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!

Avatar
bartvanirsel

Community Member, 96 Posts

18 March 2010 at 8:48am

Edited: 18/03/2010 8:49am

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.

Avatar
jasonthkim

Community Member, 3 Posts

18 March 2010 at 8:56am

How would I go about reinstalling silverstripe?

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

Avatar
bartvanirsel

Community Member, 96 Posts

18 March 2010 at 9:08am

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

Avatar
jasonthkim

Community Member, 3 Posts

18 March 2010 at 9:14am

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