Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i need a help.already we have mode rewrite rule RewriteRule ^(.*).html$ index.php?set=$1 this rule change html url to php now in this i need to add a condition https redirect how with this existing cocan i add new feature.

share|improve this question

closed as not a real question by Scott Pack, rnxrx, Adrian, Michael Hampton, Iain Oct 14 '12 at 14:26

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

1 Answer

Put this at the top of your file:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

So it looks something like this

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# .. any other rules .. #

RewriteRule ^(.*).html$ index.php?set=$1
share|improve this answer
Hi Jay, Thanx for u r solution, i tried u r solution its working but i have small problem ours frame work loads the page with help of controls and template files EX (example.com/home/login.html) first go to the controler/home.php then login() method get the content then redirect display method like joomla and other frame work after this change in htaccess when user click the action [example.com/home/login.html] its directly open this page in browser but not working properly sorry i dont know how to explain my problem plzz adjust my wordings and help me. – suresh Sep 25 '12 at 15:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.