# .htaccess | clean url | problems

**URL:** <https://forum.kirupa.com/t/htaccess-clean-url-problems/224180>\
**Category:** programming\
**Created:** [April 29, 2007, 4:52pm UTC](https://forum.kirupa.com/t/htaccess-clean-url-problems/224180 "2007-04-29T16:52:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreas\_h87](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@andreas\_h87](https://forum.kirupa.com/u/andreas_h87)\
**Post date:** [April 29, 2007, 4:52pm UTC](https://forum.kirupa.com/t/htaccess-clean-url-problems/224180/1 "2007-04-29T16:52:21Z")

</div>

**Hey everybody! I’m new to .htaccess and today, I tried to make the tutorial about Clean URLs with Apache. I am not sure, why it doesn’t show a clean url. I will show you the code of my example and what I changed in the “httpd.conf” file.**

Firstly, I opened the httpd.conf file to clean the symbol in front of this row “LoadModule rewrite\_module modules/mod\_rewrite.so”.

Secondly, I created a new file within my htdocs folder called “index.php”.

```auto
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <style type="text/css">
  body {
    font: 11px Arial; 
    color: #000;
  }
  a {
    text-decoration: none;
    color: #000;
    padding-left: 5px; padding-right: 5px;
  }
  a:hover {
    color:#ff0000;
  }
  </style>
  </head>
  
    <body>
    
    <h1>.htaccess</h1>
    <p><a href="index.php?category=home">Home</a> | <a href="index.php?category=about">About<strong>Me</strong></a> | <a href="index.php?category=work">Work</a> | </p>
    
    <hr style='border: none; border-top: 2px solid #000;' />
    
    <?
    if (isset($_GET['category'])) {
      $file = $_GET['category'] . ".php";

      if(file_exists($file)) {
        include $file;
      } else {
        echo 'Page not found!';
      }
    } else {
      include("home.php");
    }
    ?>
  </body>
</html>

```

Thirdly, I created the other files called “home.php, about.php, work.php”.

A last, I created the file “.htaccess” with the same code like in the tutorial.

```auto

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^([a-zA-Z0-9\-]+)/?$ index.php?category=$1 [L,QSA]
RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/?$ index.php?category=$1&page=$2 [L,QSA]
RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/?$ index.php?category=$1&page=$2&section=$3 [L,QSA]

```

Thanks!
