Hello,
currently my .htacces looks like this:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^(.*[^/])/?$ /$1.php [QSA,L]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ Product.php?categorie=$1&subcategorie=$2&slug=$3 [L]
In my website I have two types of files.
1. Dynamc one where all product details are shown (Product.php)
This rewrite: RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ Product.php?categorie=$1&subcategorie=$2&slug=$3 [L] makes sure I can use this URL:
mysite.nl/XXX/YYY/ZZZ (NEW)
instead of:
mysite.nl/Product.php?categorie=XXX&subcategorie=YYY&slug=ZZZ (OLD)
This works fine, but I would really like to have the old URL also redirected to the new one.
2. Normal non dynamic URL's. The rest of my files are non dynamic and normally uploaded on my server. They look like this:
Contact.php (OLD)
Shoppingcart.php (OLD)
etc.
Thanks to
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^(.*[^/])/?$ /$1.php [QSA,L]
I can link directly to:
Contact/ (NEW)
Shoppingcart/ (NEW)
etc
How can I also make sure that the old URL's are also redirected to the new ones. I've tries everything, but cant seem to get it to work...
Thanks.