LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > Add and use rewrite rules

Reply
 
Thread Tools Display Modes
  #1  
Old 05-23-2010, 10:09 AM
Fill Fill is offline
New Member
 
Join Date: May 2010
Posts: 3
Default Add and use rewrite rules

Hey guys,

I'm new with LiteSpeed and I can confess that I'm quite a noobish user, just discovering how linux stuff and webservers work.

I've just installed litespeed on my home server for testing purposes and installed phpmyadmin. Also, I've created a self-signed SSL certificate to make my web-admin login safer, as well as my phpmyadmin login. Everything's running smoothly just as I want, but I would like my server to redirect http requests on my phpmyadmin address to https

I found a page on litespeed support wiki which tells me to add some rewrite rules.

I tried to add it but it doesn't seem to work at all. Maybe I'm missing something? Here's a screenshot of what I have on my phpmyadmin virtualhost configuration (using a no-ip based domain name):


and yes, I saved changes, applied them and made a graceful restart. But http is not redirecting to https

What's wrong?

Thanks in advance,
Fill
Reply With Quote
  #2  
Old 05-23-2010, 10:10 AM
Fill Fill is offline
New Member
 
Join Date: May 2010
Posts: 3
ops sorry guys, I couldn't put the image because I have less than 5 posts

Here's the link for the image:

i49.tinypic.com/35d3pn9.jpg
Reply With Quote
  #3  
Old 05-23-2010, 08:38 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
hmm...you refer this wiki page:
http://www.litespeedtech.com/support...https_redirect

it looks right. any info in error.log or stderr.log?

you mean when you access

http://yourserver.com/, it won't redirect to https://yourserver.com ?
Reply With Quote
  #4  
Old 05-28-2010, 03:48 PM
Fill Fill is offline
New Member
 
Join Date: May 2010
Posts: 3
Hi,

I didn't know what was the prob., but I used .htaccess instead of server-wide rewrite-rules on control panel and it worked. Thanks for the help anyway.

best regards,
Fill
Reply With Quote
  #5  
Old 05-28-2010, 07:30 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
Thanks for the feedback. For server-wide rewrite rule, it should be

Code:
rewriteCond %{HTTPS} !on
rewriteCond %{HTTP:X-Forwarded-Proto} !https
rewriteRule ^/(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
i.e., need an extra "/" in line 3. I wasn't aware of this either in my last post.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:58 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.