Forum Moderators: phranque
I know this is wrong - anyone have the correct syntax (and the missing RewriteCond)?:
RewriteRule http://www.example.com/contact/ [secure.example.com...] [R=301,L]
[edited by: jdMorgan at 9:37 pm (utc) on Nov. 16, 2007]
[edit reason] example.com [/edit]
RewriteCond %{SERVER_PORT}!^443$
RewriteCond $1 ^contact
RewriteRule (.*)$ [secure.example.com...] [R=301,L]
Seems to work...
[edited by: jdMorgan at 9:37 pm (utc) on Nov. 16, 2007]
[edit reason] example.com [/edit]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^contact https://secure.example.com/contact/ [R=301,L]
Jim
[edited by: jdMorgan at 8:20 pm (utc) on Nov. 16, 2007]
A proper solution might be:
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^contact/?$ https://secure.example.com/contact/ [R=301,L]
Jim
All of the following requests are properly (301) redirecting:
http://example.com/contact
http://example.com/contact/
http://www.example.com/contact
http://www.example.com/contact/
to:
[secure.example.com...]
...
RewriteEngine on
RewriteBase /
# Switch to https
RewriteCond %{HTTPS} off
RewriteRule ^7\+second\+opinion/$ [example.com.au...] [R=301,L]
# Switch back to http if https request
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^/7\+second\+opinion/
RewriteRule (.*) http://www.example.com.au/$1 [R=301,L]
# Check that we are not in the images or scripts dir or on our main index.php processing file,
# then rewrite the "dir" after our base directory as a parameter into our main index.php file
#URI
RewriteCond %{REQUEST_URI} !common
RewriteCond %{REQUEST_URI} !includes
RewriteCond %{REQUEST_URI} !php
RewriteCond %{REQUEST_URI} !javascript
RewriteCond %{REQUEST_URI} !images
RewriteCond %{REQUEST_URI} !old
RewriteCond %{REQUEST_URI} !admin
RewriteCond %{REQUEST_URI} !pdf
RewriteCond %{REQUEST_URI} !webalizer
RewriteCond %{REQUEST_URI} !video
#FILENAMES
RewriteCond %{REQUEST_FILENAME} !index.php
RewriteCond %{REQUEST_FILENAME} !sitemap.xml
RewriteCond %{REQUEST_FILENAME} !main_styles.php
RewriteCond %{REQUEST_FILENAME} !javascript.js
RewriteRule ^(.+)$ index.php?dir=$1
#Rule to ensure that images work no matter which "dir" we are in
RewriteRule images/(.+)$ images/$1
php_flag register_globals on
AddType video/x-flv .flv
AddType application/x-shockwave-flash .swf
[edited by: jdMorgan at 2:43 pm (utc) on Nov. 27, 2007]
[edit reason] example.com [/edit]