views:

185

answers:

2

hi,

Currently, my .htaccess file looks like htis:

IndexIgnore */*
RewriteEngine on
RewriteRule ^add /add.php
RewriteRule ^add/$ add.php
RewriteRule ^sitemap.xml /xmlsitemap.php
RewriteRule ^([^/\.]+)$ /index.php?slug=$1
RewriteRule ^([^/\.]+)/$ /index.php?slug=$1

It works fine for links as: site.com/category/

However, i would like the complete slug after site.com/. So that i can redirect site.com/category1/subcategory2/subsubcategory3 etc. There can be an unknown amount of subcategories inside a category.

I tried with request_uri but that didn't really work out.

How to do this? Thanks a bunch!

+1  A: 

EDIT:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* slug.php?%{QUERY_STRING} [L]

this will pass URL to slug.php

dusoft
thx! however, if i do that, i get: http://www.domain.com/index.php?slug=index.php
Maurice Kroon
thx again.. it stays in the url now yes. but... it gives me a 500 internal server error when i set something behind domain.com/. domain.com works however, if i use domain.com/category it doesn't
Maurice Kroon
A: 

ok, got it. it's simply: deleting the ^/. from the regex. i just figured that means that it has to stop at any / :) but... thx! it works now! :)

Maurice Kroon