Reputation: 1331
I need to convert links such as
http://www.example.co.uk/blog/archive.php?date=2012-05
to
http://www.example.co.uk/blog/archive/2012/05/
using php or .htaccess file.
.htaccess file
RewriteEngine on
RewriteRule ^blog/archive/([0-9]+)/([0-9]+)/$ http://www.example.co.uk/blog/archive.php?date=$1-$2 [NC]
Ive have tried this but not having any luck. Any ideas or help would be appreciated.
Upvotes: 1
Views: 246
Reputation: 785196
Put this code in your .htaccess
under DOCUMENT_ROOT
directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^blog/archive/([0-9]+)/([0-9]+)/?$ blog/archive.php?date=$1-$2 [NC,L,QSA]
Upvotes: 1