This is how to do it via PHP, not sure how to with .htaccess.
if($_SERVER['ssl_access'] != 1 && $_SERVER['HTTPS'] != on)
header("Location: https://www.yourdomain.tld/$_SERVER[SCRIPT_URL]");
Quote:
|
Originally Posted by Sketch
& Also,
I have this code;
Code:
RewriteRule ^about/$ about [R]
I just want to get rid of the slash. And it directs me to http://mysite.com/home/myusername/home/about
Why does it do this? Is there anything I can do to stop this?
|
I know on my server, it automatically puts the trailing / on folders. I get stuck in loop when I try to redirect it because of that. This is what I was using, maybe it will work for you or get you going in the right direction:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/about/$ [NC]
RewriteRule (.*) /about
-the mole