apache - htaccess silent redirect with several htaccess files -


so have been working on problem past few days. tried number of solutions found on here, none of ended working. here issue:

i have 2 sites, first being root-level corporate site, next being different site under same domain.

site 1: www.domain.com/ site 2: www.domain.com/site2/

each of these have own htaccess file.

now, trying change url of site2, (and pages under it) read as

www.domain.com/newsitename/

unfortunately, cannot change directory name on server, have via htaccess.

so trying make if go to:

www.domain.com/newsitename/anypage.php pulls content www.domain.com/site2/anypage.php, not change url.

so here .htaccess have tried:

options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase /site2/  rewriterule ^(.*)/site2/(.*)$ $1/newsitename/$2 [l,nc] 

i have tried placing on both www.domain.com/ htaccess , www.domain.com/site2/ htaccess.

any , appreciated.

thanks, joe


edit

so has been pointed out me below code should on domain.com/ htaccess, , there issues code. have updated following:

options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase /  rewriterule ^newsitename/(.*)$ /site2/$2 [l,nc] 

this should take page www.domain.com/newsitename/ , silent redirect same page under www.domain.com/site2/. correct on this?


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -