# Apache mod_rewrite issue (RESOLVED)

## Akaihiryuu

I have a couple of things that I want to redirect from HTTP to HTTPS using mod_rewrite.  One of them is working, the other isn't.  This one works fine.

```
<Directory "/var/www/www.internal.lan/htdocs/phpmyadmin">

        RewriteEngine On

        RewriteCond %{HTTPS} !=on

        RewriteRule ^/?(.*) https://%{SERVER_NAME}:8443%{REQUEST_URI} [R,L]

</Directory>
```

An identical rule for a different dirctory is not redirecting.  This makes no sense whatsoever, the rules are absolutely identical.

```
<Directory "/var/www/www.internal.lan/htdocs/roundcube">

        RewriteEngine On

        RewriteCond %{HTTPS} !=on

        RewriteRule ^/?(.*) https://%{SERVER_NAME}:8443%{REQUEST_URI} [R,L]

</Directory>
```

----------

## Akaihiryuu

Ok, I found out there was an .htaccess in the roundcube directory conflicting with my mod_rewrite rule.  Roundcube itself supports forcing HTTPS, so in defaults.inc.php I set force_https to 8443, and I don't need a rewrite rule for it after all.

----------

