The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 3 of 3

Thread: mod_rewrite slowing site

  1. #1

    Afrostyle mod_rewrite slowing site

    Hello,
    I came up with a rule that gives translates the following:

    www.example.com/home/HomeSubPage/
    to
    www.example.com/index.php?var=home/HomeSubPage/

    Now, this works - if I echo out the var GET variable, I get
    home/HomeSubPage/

    But when I was just testing on a simple file it worked fine for about 90% of the time, and the other 10% it got stuck and kept firefox in loading mode ( i had to restart apache to get to run again)

    But it really really slows down the web site I am applying this to 100% of the time. The html isnt rendered in the browser, but if I hit view source, it shows me all the source...and its still says its loading. I have to wait about 2 minutes before the html is rendered.

    In the code below, I commented out the second last line, that will translate

    www.example.com/home.html
    to
    www.example.com/index.php?var=home

    now THAT works flawlessly 100% of the time, so that confirms that the problem is probably in my RewriteRule and not the web site.

    I have the following in my .htaccess file:

    Code:
    Code:
    Options
    RewriteEngine on
    
    
    RewriteCond %{REQUEST_URI} !-d
    RewriteCond %{REQUEST_URI} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    
    #RewriteRule ^([-a-zA-Z0-9/]+)\.html$ index.php?var=$1 [L]
    RewriteRule ^((([-a-zA-Z0-9]+)/?)+)/?$ /index.php?var=$1 [L]
    can anyone see the problem?

    Thanks

  2. #2
    Mod_rewrite is very slow, you can either not use it or deal with it basically!

    and what is the point of:
    Code:
    RewriteCond %{REQUEST_URI} !-d
    RewriteCond %{REQUEST_URI} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    Web Design and Web Development blog
    Designer Notice: Browser List for design compatibility

  3. #3
    The second rule may take longer basically because it is performing 3 regex searches (regex is heavy on the processor).
    Web Design and Web Development blog
    Designer Notice: Browser List for design compatibility

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012