Let me explain by example — I want the web server to redirect a URL like http://example.com/-NUM to http://example.com/?p=NUM i.e. for instance, http://example.com/-121 should be redirected to http://example.com/?p=121.
In this case, what should the .htaccess redirection rules look like?
The pattern
^-(\d+)$will match numeric URI’s beginning with a hyphen and capture into$1.If this is a PHP script, for example, you may need to use
index.phpas the target: