Hey,

I have the following htaccess file but cant get the dam thing to work... I need the following...

/admin/test/ -> /admin/test.php
/home/ -> home.php (/xx/ -> xx.php

Then to include ?key=var.... etc

RewriteEngine On  

RewriteBase /

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

RewriteRule ^admin/(.*) admin/$1.php [L]

RewriteRule ^([a-z0-9\-]+)/?$ $1.php [NC,L,QSA]
RewriteRule ^([a-z0-9\-]+)/([a-z0-9\-]+)/?$ $1.php?page=$2 [NC,L,QSA]

Thanks
Dan

I think you're overcomplicating this.

Something like:

RewriteRule ^admin/([a-z]+)/$ admin/$1.php [L]
RewriteRule ^([a-z]+)/$ $1.php [L]
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.