I have this simple rewrite rule and it works properly under http:
RewriteCond %{HTTP_HOST} ^www\.siku-siku\.com$
RewriteRule ^/work/all.html /portfolio/ [L,R=301]
However, the rule doesn't take into effect when I was on https. I modified the rule set to the following but to no avail.
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.siku-siku\.com$
RewriteRule ^/work/all.html /portfolio/ [L,R=301]
How can I make that rule to work both on http and https? Please let me know if I need to provide more information.
A rewrite rule defines the logic of what to compare or match the request URL with, and what to do if the comparison is successful. Rewrite rules consists of the following parts: Pattern – The rule pattern is used to specify either the regular expression or a wildcard pattern that is used to match URL strings.
Apache uses a different vhost for ssl configuration:
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.siku-siku\.com$
RewriteRule ^/work/all.html /portfolio/ [L,R=301]
...
</VirtualHost>
</IfModule>
This link has an example for configuring Apache with SSL on Debian, but should be easy to extrapolate to whichever platform you are on http://www.debian-administration.org/articles/349
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With