Forum Moderators: phranque
Just a quick one and very simple. I have the following line in my htaccess file which works fine.
RewriteRule ^home_(.*)$ home?180_version=$1
But know I have new pages popping up and need to cover this dynamic side. The below line works fine for a present page:
RewriteRule ^day25_(.*)$ day25?180_version=$1
However the number 25 will be changing as new pages are created. How do I accomodate this? I have tried:
RewriteRule ^day[^/]_(.*)$ day[^/]?180_version=$1
but I get a 404 error.
Thanks in advance,
R
Try this, which accepts one or more digits preceding the slash and passes them to the substitution:
RewriteRule ^day([0-9]+)_(.*)$ /day$1?180_version=$2
RewriteRule ^day([0-9]+)_(.*)$ day$1?180_version=$2
I removed the forward slash you'd put in before the second day. But I think that I'll have to put it back in when I put the site online as my home test server setup is different to my online one.
Thanks again,
R