I’m using mod_rewrite to redirect on URLs like: mysite.com/123
RewriteEngine On
RewriteRule ^([0-9]+)$ /n/index.php?id=$1 [L]
This works only for numeric IDs.
How do I make it work for non-numeric IDs while I preventing the redirect from happening when a subdirectory is found?
Change the rewrite rules to this: This should work for both numeric as well as non-numeric IDs preventing the redirect from happening when a subdirectory is found.