Is using PHP faster than htaccess?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fireorange
    Confirmed User
    • Jan 2005
    • 1648

    #1

    Is using PHP faster than htaccess?

    Say I wanted to 301 redirect traffic to different page depending on HTTP referer, will using PHP be better?

    Under high traffic (200k uniques per day).
  • riddler
    Confirmed User
    • Oct 2004
    • 3726

    #2
    you wouldnt think so since .htaccess is a coded part of apache and other web servers, i never have tried, give it a try and see how it works out.

    Comment

    • woj
      <&(©¿©)&>
      • Jul 2002
      • 47880

      #3
      .htaccess should be faster...
      Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
      Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
      Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

      Comment

      • psili
        Confirmed User
        • Apr 2003
        • 5526

        #4
        If possible, modify your apache VirtualHost which would be the fastest since it's not checked on each page request. However, I'm not 100% certain that the .htaccess file is.

        So don't read this post, because I dunno what I'm saying.

        Sorry.
        Your post count means nothing.

        Comment

        • kernelpanic
          Too lazy to set a custom title
          • Jan 2005
          • 2961

          #5
          htaccess is much faster than php, at the (small) expense of having to run mod_rewrite


          ZangoCash - Turn Your Traffic Into Ca$h.
          $.40 Per Install - No Tier

          Comment

          • chupachups
            Confirmed User
            • Dec 2002
            • 6576

            #6
            Php doesnt stand a chance

            Comment

            • Tempest
              Too lazy to set a custom title
              • May 2004
              • 10217

              #7
              If you can (dedicated server for example), put anything "permanent" into your web server config file and not the htaccess file... the htaccess file has to be loaded for each request... That will be the absolute fastest.

              Comment

              • prime
                Confirmed User
                • Feb 2005
                • 400

                #8
                put the config line in httpd.conf first - this is faster because the settings are loaded into memory after apache was started. unlike .htaccess which are loaded everytime the page is access.

                php vs htaccess = i think php, but not 100% sure

                | offshore solutions | manual labor | staff leasing | and more!
                Dedicated -Motivated-Managed Employees
                icq.: 309570461 live chat

                Comment

                • fireorange
                  Confirmed User
                  • Jan 2005
                  • 1648

                  #9
                  Originally posted by prime
                  put the config line in httpd.conf first - this is faster because the settings are loaded into memory after apache was started. unlike .htaccess which are loaded everytime the page is access.
                  Aaah yes! I've read about that before but forgotten about it, thanks

                  Comment

                  • pornpf69
                    Too lazy to set a custom title
                    • Jun 2004
                    • 15782

                    #10
                    I have absolute no clue about it....but it would be interesting to find out...

                    Comment

                    • Terenzo
                      Confirmed User
                      • Jan 2002
                      • 971

                      #11
                      can i have an image directory protected from the httpd.conf instead with an .htaccess file when the .htaccess file in the domain.com/images/ directory looks like:

                      RewriteEngine On
                      RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain\.com/ [NC
                      RewriteCond %{HTTP_REFERER} !^$
                      RewriteRule \.(jpe?g|gif|bmp|png)$ http://www.domain.com/ [L]



                      and what would that code be?
                      many thanx.
                      Signature Spot - USD 5000 / month

                      Comment

                      • fris
                        I have to go potty
                        • Aug 2002
                        • 55879

                        #12
                        there is a lot you can do with mod_rewrite.


                        you can go really deep into it.

                        there are some really good docs on it
                        Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


                        My Newest Theme

                        Comment

                        Working...