Click here to Skip to main content
15,886,085 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I'm really stuck with an .htaccess problem and wondered if anyone could help? I have a url on a server which needs to redirect to another url on a different server. Three directories from the original url need to be accessed so no divert.

What I have tried:

I have tried the following:

Options +FollowSymLinks
RewriteEngine On
Rewritecond %{http_host} ^originalurl\.com [NC]
RewriteCond %{REQUEST_URI}!^/(downloads|Footer|newsletters)/ [NC]
Rewriterule ^(.*)$ http://newurl.info/$1 [L,R=301]

The divert does not occur and and access to the directories gives an error. The following version works ok but with only one directory access rather than three.


Options +FollowSymLinks
RewriteEngine on
RewriteRule !^downloads($|/) http://www.newurl.info/ [L,R=301]

Any help would be very much appreciated.
Posted
Comments
RedDk 21-Aug-18 13:40pm    
Does clicking on "htaccess" tag (next to "See more:" just above this post) and viewing some of the relevant QA posts here in CP help any?
IKONN 21-Aug-18 13:54pm    
Thanks. I did try but nothing that really answered my problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900