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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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 set .htacess for static pages


Go to End


4 Posts   937 Views

Avatar
Stephan

Community Member, 55 Posts

27 March 2009 at 6:09am

Hi experts,
we do have static pages where our customer can see the statistics of his page
He can access them with http://<domain>/statistic (symbolic link in webserver).
But now sapphire wants to take care of this :-(
How do I have to change my .htaccess to do this ?

I have tried several configrations which worked
perfect for my statstics site, but then /admin didn't work any longer.

TIA Stephan

Avatar
Hamish

Community Member, 712 Posts

27 March 2009 at 8:11am

You need to exclude /statistics urls being passed to sapphire. After this line:

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

Add this:

RewriteCond %{REQUEST_URI} !(\\statistic) 

That is, if the URL contains "\statistic", don't rewrite the url to sapphire.

Avatar
Stephan

Community Member, 55 Posts

27 March 2009 at 10:15pm

Hi,
thanks, but this doesn't work :-(

I get the 404 page (page not found) from silverstripe.

Stephan

Avatar
Hamish

Community Member, 712 Posts

28 March 2009 at 12:55am

In that case, the rule is incorrect. I'm not an expert in rewriting rules, so have a look at the apache module documentation. Basically you just want to add a condition so that if the path is to your symlink, it is ignored.