- Code: Select all
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/blog/([0-9]+)
RewriteRule ^(.*) /blog.php?id=%1 [L]
...but I want to get it working with the following URL - /view/2004-07-20, which will redirect to /view.php?xml=2004-07-20.xml
I've tried variations on these lines:
- Code: Select all
RewriteCond %{REQUEST_URI} ^/(([0-9]{4})-([0-9]{2})-([0-9]{2}))$
RewriteRule ^(.*)$ view.php?xml=$1
-----
RewriteRule ^view/.*([0-9]{4})-([0-9]{2})-([0-9]{2}) /view.php?xml=$1
-----
RewriteRule /view/([0-9]{4})-([0-9]{2})-([0-9]{2}) /view.php?xml=$3 [L]
I can't get any of them to work, only return a 404 error. Can anyone help?