# URL Rewriting with .htaccess

**URL:** <https://forum.kirupa.com/t/url-rewriting-with-htaccess/288941>\
**Category:** programming\
**Created:** [May 23, 2009, 5:05pm UTC](https://forum.kirupa.com/t/url-rewriting-with-htaccess/288941 "2009-05-23T17:05:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkohne](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@mkohne](https://forum.kirupa.com/u/mkohne)\
**Post date:** [May 23, 2009, 5:05pm UTC](https://forum.kirupa.com/t/url-rewriting-with-htaccess/288941/1 "2009-05-23T17:05:44Z")

</div>

Hello.

I’m trying to clean up my URLs using mod\_rewrite but I cannot for the life of me get it to work. For example, I’m trying to rewriting **profiles.php?attorney\_id=1** to **attorney-1.html**. Here is my code in my .htaccess file:

```auto
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^attorney-([0-9]+)\.html$ profiles.php?attorney_id=$1

```

I’m testing this both locally (testing server) and remotely, and cannot get it to do anything. No errors, just the same address comes up. Example: [http://s53249.gridserver.com/profiles.php?attorney\_id=1](http://s53249.gridserver.com/profiles.php?attorney_id=1).

Mod\_rewrite is enabled both locally and remotely. I’ve also tried changing the RewriteBase, but still nothing. What am I missing?
