Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://www.mywebsite.co.uk/mypage
- RewriteEngine On
- RewriteBase /
- # Force WWW prefix
- RewriteCond %{HTTP_HOST} !^$
- RewriteCond %{HTTP_HOST} !^www. [NC]
- RewriteCond %{HTTPS}s ^on(s)|
- RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
- # Force SSL
- RewriteCond %{HTTPS} off
- RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
- # Remove .php extension
- RewriteCond %{THE_REQUEST} ^GET /[^?s]+.php
- RewriteRule (.*).php$ /$1/ [L,R=301]
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_URI} ^/(.+)/$
- RewriteCond %{DOCUMENT_ROOT}/%1.php -f
- RewriteRule ^(.*)/$ $1.php [L]
- # Force trailing slash
- RewriteCond %{REQUEST_FILENAME}.php -f
- RewriteRule .*[^/]$ $0/ [L,R=301]
- https://www.mywebsite.co.uk/mypage
- https://www.mywebsite.co.uk/mypage/
Add Comment
Please, Sign In to add comment