How to use Apache .htaccess to redirect to another folder -


i want redirect old folder new one.

i want redirect http://domain.com/old/* urls http://domain.com/new/*.

i found question that: redirect folder htaccess

i've tried writing .htaccess in document root following code given in answer above question:

options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase / rewriterule ^/old/(.*)$ /new/$1 [l,nc,r=302]  

i've enabled mod_rewrite in httpd.conf file. still can't apache redirect old folder new folder.

i've check apache error logs, , following error:

[error] [client x.x.x.x] file not exist: <documentroot>/old 

i skip using med_rewrite , instead use redirect, if want requested old directed new.

<directory />     redirect permanent /old /new </directory> 

you skip permanent (specifies redirect code) depending on needs. able use local url need run apache >= 2.2.6.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -