Link to home
Start Free TrialLog in
Avatar of xiaoyunwu
xiaoyunwuFlag for United States of America

asked on

permanent redirect 301

All our URLs has been shortened:
FROM: http://www.test.com/abc/yy/xxx.do 
TO: http://www.test.com/xxx.do 
and all the xxx.do page is processed by JBoss.  
In mod_jk.conf there's one line
JkMount /*.do node

My question is: how do I make all the 301 permanent redirect if user has bookmarked
http://www.test.com/abc/yy/xxx.do to http://www.test.com/xxx.do?

Is it in apache mod rewrite, if so, how to do it?
Avatar of Norm Dickinson
Norm Dickinson

If nothing else you could leave a page at each former address with a meta refresh to the new URL. That's the long way...old school...but it could work.
Avatar of xiaoyunwu

ASKER

there's too many pages to do this.
ASKER CERTIFIED SOLUTION
Avatar of Norm Dickinson
Norm Dickinson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
after I added:
RewriteEngine on
I got the following error:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
httpd (no pid file) not running
httpd.conf

LoadModule rewrite_module modules/mod_rewrite.so
 

RewriteEngine on

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

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