Rewriting a number based URL using .htaccess RewriteRule

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2010-03-17T05:16:49Z Indexed on 2010/03/17 5:21 UTC
Read the original article Hit count: 251

How can I rewrite a simple number based URL to a sub folder?

I want http://mysite.com/123 to redirect to http://mysite.com/en/123.

The number could be anything from 1 - 9999. My attempt in htaccess was:

RewriteRule ^([0-9]+)$ /en/$1/ [R]

But that doesn't work.

© Stack Overflow or respective owner

Related posts about .htaccess

Related posts about mod-rewrite