I want to redirect every URLs contain number at end to subdomain :
http://example.com/773 to http://blog.example.com/773
and not redirect URLs contain strings like this :
http://example.com/web or http://example.com/web/shop or http://example.com/about
i used this htaccess code :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/[0-9]
RewriteRule (.*) http://blog.example.com/$1 [R=301,L]
</IfModule>
but this htaccess code redirect URLs like this :
http://example.com/773 to http://blog.example.com/blog/773
The rule below will redirect ONLY this sort of URLs only:
http://example.com/773. If URL will be likehttp://example.com/somfolder/773(with some folder in the path) then nothing will happened.