# mod\_rewrite slowing site

**URL:** https://forum.kirupa.com/t/mod-rewrite-slowing-site/246943
**Category:** programming
**Created:** [December 17, 2007, 12:30am UTC](https://forum.kirupa.com/t/mod-rewrite-slowing-site/246943 "2007-12-17T00:30:29Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DaDeViL](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@DaDeViL](https://forum.kirupa.com/u/DaDeViL)
#### Post date: [December 17, 2007, 12:30am UTC](https://forum.kirupa.com/t/mod-rewrite-slowing-site/246943/1 "2007-12-17T00:30:29Z")

</div>

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

[www.example.com/home/HomeSubPage/](http://www.example.com/home/HomeSubPage/)  
to  
[www.example.com/index.php?var=home/HomeSubPage/](http://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](http://www.example.com/home.html)  
to  
[www.example.com/index.php?var=home](http://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:

```auto

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
