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.

Hosting Requirements /

What you need to consider when choosing a hosting provider and plan.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

.htaccess rules to make SS ignore a URL


Go to End


6 Posts   3189 Views

Avatar
te_chris

Community Member, 24 Posts

20 October 2010 at 9:01pm

Hey guys,

So i've deployed a site to an un-managed VPS and am just going through the process of getting everything runnig. Have SS up and running so far without a hitch, everyhting feel fast etc. Have just finished doing some security stuff to the server and am now onto setting up AWStats. I have AWSTats up and running as far as I can tell, the problem is that I need it to respond to domain.tld/ask_statz (made weird to try and through the script kiddies). How do I make SS ignore that one url? I'm assuming it's to do with intercepting the request @ htaccess before it gets sent through the sapphire maze.

If anyone could help that would be really awesome.

Chris

Avatar
bummzack

Community Member, 904 Posts

20 October 2010 at 10:27pm

Is ask_statz a folder? If yes, it's probably best to place a new .htaccess file there where you add the following:

<IfModule mod_rewrite.c>
	RewriteEngine Off
</IfModule>

This will override any previous rules from other .htaccess files.

Avatar
te_chris

Community Member, 24 Posts

21 October 2010 at 9:01am

The ask_statz isn't a folder. AWStats is a server statistics package written in perl and installed outside the /srv/www directory. at the moment i've got .htaccess in /etc/awstats which supposedly works for others (i'm using it to password protect the stats)
but SS is still getting the request as far as i can tell. I'm assuming that .htaccess gets processed before the main.php bootstrapper? If i just add some sort of rule that makes htaccess not send /ask_statz/ to the bootstraper will that work?

Avatar
Willr

Forum Moderator, 5523 Posts

21 October 2010 at 8:11pm

You can add this condition to the .htaccess file

RewriteCond %{REQUEST_URI} !^/foldername/.*

Avatar
te_chris

Community Member, 24 Posts

22 October 2010 at 3:18pm

Tried that, still no luck.

Avatar
Willr

Forum Moderator, 5523 Posts

22 October 2010 at 5:23pm

Where did you add that line? that line should ignore it. Perhaps try RewriteCond %{REQUEST_URI} !^/foldername so it includes the /foldername as well.