Forum Moderators: phranque

Message Too Old, No Replies

Redirecting particular page using httpd.conf file

         

arunrajiah

9:44 am on Jul 13, 2012 (gmt 0)

10+ Year Member



Hi,

I have webpage http://www.example.com/en/signin/

I want to redirect the page to https://www.example.com/en/signin/

I tried the below in httpd.conf file but it doesnt work for me. Can anyone please help me on this?

Thanks in advance.

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^signin$ [%{HTTP_HOST}%{REQUEST_URI}...]

phranque

11:37 am on Jul 13, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



^signin$


in that context the requested uri will not be exactly that specified pattern.

g1smd

1:09 pm on Jul 13, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



..... Del

[edited by: g1smd at 1:10 pm (utc) on Jul 13, 2012]

g1smd

1:09 pm on Jul 13, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The requested URL has more characters than is in the pattern so will not match.

arunrajiah

5:39 am on Jul 16, 2012 (gmt 0)

10+ Year Member



Thanks for the details.

So, which pattern should i use? can you please advise

g1smd

6:16 am on Jul 16, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Requested URL:
en/signin/


Current pattern that doesn't match:
^signin$


Change the pattern to match the requested URL.

arunrajiah

6:29 am on Jul 16, 2012 (gmt 0)

10+ Year Member



RewriteRule ^/signin(.*) [%{HTTP_HOST}%{REQUEST_URI}...] [R,L]

Does this work?

arunrajiah

6:33 am on Jul 16, 2012 (gmt 0)

10+ Year Member



Also one more clarification.. i am doing the testing in my development environment.

So after making changes in httpd.conf, i'm accessing the url using IP Address.. [10.0.0.1...]

This could be the problem?

phranque

8:15 am on Jul 16, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



the problem is that your pattern is still not matching the requested url.

your requested url is 'en/signin/' and your pattern says match anything beginning with '/signin' followed by anything or nothing.