Reputation: 21
forums/test.654654564/44654562356456-blabla.html
I want to redirect this kind of URL...
I had this RegEx
^\/forum\/.+\.([\d]+)\/([\d]+)-.+\.html$
Unfortunately, the error that also handles this URL is
forums/test.654654564/44654562356456-blabla.2332423233242.html
This must not be allowed to happen. Any ideas?
The rule should be that as soon as the '.html' is preceded by .\[\d+]
it should be ignored. is for an nginx redirect.
Upvotes: 0
Views: 74
Reputation: 320
The regular expression required can be achieved by substituting the .+ in front of the .html bit with [a-zA-Z0-9] instead:
^\/forums\/.+\.([\d]+)\/([\d]+)-[a-zA-Z0-9]+\.html$
Upvotes: 1