Apache redirection


 
Thread Tools Search this Thread
Top Forums Web Development Apache redirection
# 1  
Old 03-31-2014
Apache redirection

Hi,

I have a setting below in my httpd.conf

Code:
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^yapp-dev.abc.com$[OR]
RewriteCond %{HTTP_HOST} ^zapp-dev.abc.com$
RewriteRule ^(.*)$ https://zapp-dev.abc.com/$1 [R=301,L]

Result:
(with https) yapp-dev.abc.com >> URL redirected to (https) yapp-dev.abc.com [which IT NOT WORKING , it remain yapp instead zapp]


Can anyone advise? Thanks.
# 2  
Old 03-31-2014
Try breaking this up into two rules and see how it works:

Code:
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^yapp-dev.abc.com
RewriteRule ^(.*)$ https://zapp-dev.abc.com/$1 [R=301,L]

Code:
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^zapp-dev.abc.com$
RewriteRule ^(.*)$ https://zapp-dev.abc.com/$1 [R=301,L]

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Process not running: /opt/java15/jdk/bin/java -classpath /opt/apache/apache-ant-1.7.0-mod/lib/ant-la

Have no idea on what the below error message is: Process not running: /opt/java15/jdk/bin/java -classpath /opt/apache/apache-ant-1.7.0-mod/lib/ant-launcher.jar org.apache.tools.ant.launch.Launcher -buildfile build.xml dist. Any help? (3 Replies)
Discussion started by: gull05
3 Replies

2. Web Development

Apache module development on apache 2.2

Hi, I'm new to developing modules for Apache. I understand the basics now and can develop something simple which allows a 'GET' request to happen, but what I want to do is actually 'POST' information to my site. I know the basic POST Request works and I can see that it is post by looking at... (2 Replies)
Discussion started by: fishman2001
2 Replies

3. Web Development

apache url redirection

I need help in apache url redirection: I have added the below command in httpd.conf and it is working fine. Redirect http://xyz.com/site/homehttp://abc.com/site/home Can we set a rule such that http://xyz.com/site/* -> http://abc.com/site/* is applied For... (0 Replies)
Discussion started by: raghur77
0 Replies

4. UNIX for Advanced & Expert Users

apache webserver url redirection

I need help in apache url redirection: I have added the below command in httpd.conf and it is working fine. Redirect http://xyz.com/site/homehttp://abc.com/site/home Can we set a rule such that http://xyz.com/site/* -> http://abc.com/site/* is applied For... (0 Replies)
Discussion started by: raghur77
0 Replies

5. UNIX for Dummies Questions & Answers

about different redirection

explain the redirections 1>, 2>, 3>, ..... and 1< ,2<,3<..... where we use these things thanks Thread moved from AIX forum (2 Replies)
Discussion started by: tsurendra
2 Replies

6. Web Development

Apache redirection

Hello I have a domain where i need a redirection as described below : i.e mydomain.com/t-ABC-048796/sample.jpg must redirect to mydomain.com/jjj/top/8796/sample.jpg As you can see from the source URL (mydomain.com/t-ABC-048796/sample.jpg) i need the last four characters... (2 Replies)
Discussion started by: unimaxlin
2 Replies

7. Shell Programming and Scripting

I/O redirection

Hello everyone,I'm reading a book and there's code fragment: exec 3>&1 ls -l 2>&1 >&3 3>&- | grep bad 3>&- exec 3>&- It says that the red part of that code does not close fd 3 but the green does close the fd 3.I can't understand that.....Why?Any predicate will be appreciated.:) (18 Replies)
Discussion started by: homeboy
18 Replies

8. UNIX for Dummies Questions & Answers

Help with Redirection

Hi Guys, I m new to UNIX and new to this forum. Was wondering if someone can help me understand redirection (standard input output pipeline etc) for starters, not too sure what this would mean who | sort > sortedfile | pr | lp im starting to understand common commands but when throwing... (2 Replies)
Discussion started by: jmack123
2 Replies

9. Shell Programming and Scripting

redirection

Hi, The code below works, it's a part of a bash shell script that serve to search a pattern $pattern_da_cercare in the files contained in a directory $directory_iniziale. Now the proble is: How can I redirect stderr to a file? PS: so I want to redirect ALL the errors to a file. I tryed... (9 Replies)
Discussion started by: DNAx86
9 Replies

10. Programming

Help with redirection

Here is my problem. I don't know make this redirection thing work. The output file (called output.c) looks like this #include<stdio.h> int main() { int k; int m; print f("%d\n", k); printf("%d\n", m); return 0; } the input file(called input.c) is this #include<stdio.h> int... (2 Replies)
Discussion started by: Shallon1
2 Replies
Login or Register to Ask a Question