# Mod rewrite directing correctly, but getting 404

**URL:** <https://forum.kirupa.com/t/mod-rewrite-directing-correctly-but-getting-404/239597>\
**Category:** programming\
**Created:** [September 24, 2007, 3:42am UTC](https://forum.kirupa.com/t/mod-rewrite-directing-correctly-but-getting-404/239597 "2007-09-24T03:42:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blazes](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@blazes](https://forum.kirupa.com/u/blazes)\
**Post date:** [September 24, 2007, 3:42am UTC](https://forum.kirupa.com/t/mod-rewrite-directing-correctly-but-getting-404/239597/1 "2007-09-24T03:42:32Z")

</div>

[COLOR=Red]EDIT: Solved. I needed to take out the forwards slash in front of $1.php.[/COLOR]

I have:

```auto
RewriteEngine On
RewriteRule ^(.*)/(.*)/?$ /$1.php?a=$2

```

And am going to:

```auto
http://localhost/webapp/test/asdf

```

But getting

```auto
The requested URL /test.php was not found on this server.

```

Even though test.php is there.

```auto

/webapp
.htaccess
test.php

```

Am I doing something wrong?

Also, going directly to test.php works.
