Home htaccess rewrite needs one exception
Reply: 0

htaccess rewrite needs one exception

user692 Published in May 22, 2018, 9:37 pm

I'm having trouble defining an exception for a single URL on a site that needs to all be https except one subdirectory.

I currently have:

## Redirect URLs to https://
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]

But I need to define an exception around www.example.com/forum so that it's always http://www.example.com/forum, without the https:// protocol.

How can I do this? I've tried all kinds of ! operators on RewriteCond, but the %SERVER_PORT seems to take precedence. Is there another RewriteCond I should consider?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.312088 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO