Home htaccess redirect and mod_rewrite appends original URL to new path
Reply: 0

htaccess redirect and mod_rewrite appends original URL to new path

Alex Fox
1#
Alex Fox Published in 2018-02-12 11:52:53Z

This seems to have been asked here but the answer does not work for me. Whatever method I use to redirect a directory, apache keeps appending the original URL to the new one.

I'm attempting to redirect with a .htaccess in a subdirectory (example name); /directory/documents/

I want redirect to (for example); v2/newdirectory/newdocuments/

but what I always end up with is v2/newdirectory/newdocuments/documents/

Given that there can be several sub-directories underneath documents/, the few methods I've got to work only work (such as RedirectMatch 301 .* /v2/newdirectory/newdocuments/) only works if the user hits the same directory as the .htaccess file, if they request a sub-directory, the redirect still functions but appends the URL and hits a 404. Is there some directive set in the conf that I need to override?

Thanks in advance!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.297364 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO