Jump to:

547 Posts in 2233 Topics by 238 members

Hosting Requirements

SilverStripe Forums » Hosting Requirements » .htaccess rules to make SS ignore a URL

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

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

Page: 1
Go to End
Author Topic: 1216 Views
  • te_chris
    Avatar
    Community Member
    24 Posts

    .htaccess rules to make SS ignore a URL Link to this post

    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

  • banal
    Avatar
    Community Member
    901 Posts

    Re: .htaccess rules to make SS ignore a URL Link to this post

    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.

  • te_chris
    Avatar
    Community Member
    24 Posts

    Re: .htaccess rules to make SS ignore a URL Link to this post

    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?

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: .htaccess rules to make SS ignore a URL Link to this post

    You can add this condition to the .htaccess file

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

  • te_chris
    Avatar
    Community Member
    24 Posts

    Re: .htaccess rules to make SS ignore a URL Link to this post

    Tried that, still no luck.

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: .htaccess rules to make SS ignore a URL Link to this post

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

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