# mod\_rewrite - using RewriteCond

**URL:** https://forum.kirupa.com/t/mod-rewrite-using-rewritecond/205460
**Category:** programming
**Created:** [October 29, 2006, 10:51pm UTC](https://forum.kirupa.com/t/mod-rewrite-using-rewritecond/205460 "2006-10-29T22:51:47Z")
**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: [October 29, 2006, 10:51pm UTC](https://forum.kirupa.com/t/mod-rewrite-using-rewritecond/205460/1 "2006-10-29T22:51:47Z")

</div>

Hey guys, im having a problem with the following code

```php

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)\.html$ index.php?page=$1 [L]

RewriteCond %{REQUEST_FILENAME} ^suspended.page
RewriteEngine off

```

I want to say that if the REQUEST\_FILENAME is not a directory and not a file that exists in the root directory, then follow: RewriteRule ^(.\*).html$ index.php?page=$1 [L]

If REQUEST\_FILENAME is a directory or a file or is ‘suspended.page’, i want to turn the Rewrite engine off. This is what I have, but it gives me a 404 not found error on something like: [http://www.domainanme.com/Home.html](http://www.domainanme.com/Home.html)

But it works for [http://www.domainanme.com/suspended.page/](http://www.domainanme.com/suspended.page/)  
or  
[http://www.domainanme.com/testdirectory/](http://www.domainanme.com/testdirectory/)

Thanks
