Monday, February 5, 2018

Apache fails to Redirect

Leave a Comment

I'm running Apache 2.4.6 on Oracle Linux 7.4

I have a redirect that, well, fails to redirect.

Here's an excerpt from my httpd.con file, showing the relevant VirtualHost definitions.

<VirtualHost *:80>      ServerAdmin mbobak@obscured.com      ServerName obscured.obscured.com      Redirect permanent / https://obscured.obscured.com/ords/f?p=300: </VirtualHost> <VirtualHost *:443>      ServerAdmin mbobak@obscured.com      ServerName obscured.obscured.com      Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;"      JkMount /* domain4      SSLEngine On      SSLProxyEngine On      SSLProtocol ALL -SSLv2 -SSLv3 -TLSv1 -TLSv1.1      SSLHonorCipherOrder on      SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4"      SSLCertificateFile      /etc/httpd/conf/ssl_certs/obscured.com/a622fe544d2b98f7.crt      SSLCertificateKeyFile   /etc/httpd/conf/ssl_certs/obscured.com/obscured.key      SSLCertificateChainFile /etc/httpd/conf/ssl_certs/obscured.com/gd_bundle-g2-g1.crt </VirtualHost> 

I have no idea what is wrong. Instead of redirecting to https://obscured.obscured.com/ords/f?p=300:, I end up at https://obscured.obscured.com

Help?

1 Answers

Answers 1

If possible you could use your .htaccess file, set it to:

RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} obscured.obscured.com [NC] RewriteRule ^(.*)$ http://obscured.obscured.com/ords/f?p=300: [R=301,NC] 

Make sure to add a blank .htaccess file in your ords sub-directory so that the redirect does't occur there.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment