so heres the scenario:

i acquired your blog around the root directory of my host i quickly located some application on the subfolder named fsGallery. now, i purchased a brand new domain for my blog and the other domain for my application. ii want to be aware of proper htaccess 301 redirects to ensure that me to redirect that old sites for their particular new domain names

here is a sample dir structure:




attempting to: redir /application to redir [blog] to

also, initially, my application accustomed to accept url parameters such as this: application/user/1234567

and so i would like to: redir /application/user/ to

can anybody assist me to plox?

Possibly not programming-related, but anyway: the best way to do that is incorporated in the virtual host configuration file (i.e. within the <VirtualHost *:80> ... </VirtualHost> section), not within an .htaccess file. The directives to make use of are

 RedirectMatch permanent /application/user/([-9+])$1

 Redirect permanent /application

 Redirect permanent /

It appears RewriteRules should work fine.

RewriteEngine on

RewriteRule ^/?application/user/([-9]+)$1 [R=301,L]

RewriteRule ^/?application(/(.*))?$$2 [R=301,L]

RewriteRule ^/?(.*)$1 [R=301,L]

You'll most likely have to adjust the groups to redirect articles correctly.