Results 1 to 3 of 3
-
08-25-2006, 02:09 PM #1Hosting Billing Master
- 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_URI} order
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]
-
08-28-2006, 03:50 AM #2Disabled
- Join Date
- Aug 2006
- Posts
- 56
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.
-
08-29-2006, 05:06 PM #3Hosting Billing Master
- 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!