Add and use rewrite rules

Discussion in 'General' started by Fill, May 23, 2010.

  1. Fill

    Fill New Member

    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
  2. Fill

    Fill New Member

    ops sorry guys, I couldn't put the image because I have less than 5 posts :mad:

    Here's the link for the image:

    i49.tinypic.com/35d3pn9.jpg
  3. NiteWave

    NiteWave Administrator

  4. Fill

    Fill New Member

    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
  5. NiteWave

    NiteWave Administrator

    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.

Share This Page