Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Location
    California, USA, Earth
    Posts
    1,098

    mod rewrite issue - what am i doing wrong?

    What I'm trying to do is send everything (Except images and other physical directories I need) to index.php, and my index.php includes the appropriate files/templates. I am also forcing our order page to be SSL, and forcing the all domains to use our main domain, in the sample www.domain.com. The problem with this set up is that if we access domain.com/page/ (without the W's), it redirects to www.domain.com/index.php and NOT www.domain.com/page/. I tried changing the order of the RewriteRule to pushes everything to index.php by moving below the www.domain.com force code, but then it doesnt force www.domain.com.

    Any ideas? scratching my head over this one.. but i'm no mod rewrite pro. Any help is GREATLY appreciated! Thanks!!

    PHP Code:
    RewriteEngine on

    RewriteRule 
    !phpmyadmin/|usage/|\.(gif|jpg|png|css|exe)$ /home/index.php

    # to make order page https
    RewriteCond %{REQUEST_URIorder
    RewriteCond 
    %{SERVER_PORT} !=443
    RewriteRule 
    https://www.domain.com%{REQUEST_URI} [NS,R,L]

    # to force www.domain.com
    RewriteCond %{HTTP_HOST} !^www.domain.com$
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301] 
    Blesta - The Billing Platform for Hosting Providers
    Client Management, Billing, & Support Software
    Trial - Demo | 714-923-7325 | Twitter @blesta

  2. #2
    Try this:

    # to force www.domain.com
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R,L]


    In this case the requested URL http://domain.com/foo.html would redirected to the URL http://www.domain.com/foo.html.

  3. #3
    Join Date
    May 2003
    Location
    California, USA, Earth
    Posts
    1,098
    That seems to work! I had to add it above the "RewriteRule !phpmyadmin/|usage/|.(gif|jpg|png|css|exe)$ /home/index.php " line, but that did the trick!

    Thanks a ton!
    Blesta - The Billing Platform for Hosting Providers
    Client Management, Billing, & Support Software
    Trial - Demo | 714-923-7325 | Twitter @blesta

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •