jamie_2008
asked on
.htaccess problem in https
i have setup https on my website. by using this code
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.cvbroadcaster.com/$1 [R]
i want to redirect this page to not https .
https://www.cvbroadcaster.com/cv_database/cv_list.php
to
http://www.cvbroadcaster.com/cv_database/cv_list.php
i have also another page to not g oto https ..just http . so what will be its rule ?
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.cvbroadcaster.com/$1 [R]
i want to redirect this page to not https .
https://www.cvbroadcaster.com/cv_database/cv_list.php
to
http://www.cvbroadcaster.com/cv_database/cv_list.php
i have also another page to not g oto https ..just http . so what will be its rule ?
ASKER
@caterham_www:
what if i want to add 2 more url's to exclude ?
above is working fine for 1 url
thanks
what if i want to add 2 more url's to exclude ?
above is working fine for 1 url
thanks
Just add more conditions like
RewriteCond %{HTTPS} =off
# exclude /cv_database/cv_list.php
RewriteCond %{REQUEST_URI} !=/cv_database/cv_list.php
RewriteCond %{REQUEST_URI} !=/other_url-path
RewriteCond %{REQUEST_URI} !=/an_other_one
RewriteRule ^(.*)$ https://www.cvbroadcaster.com/$1 [R,L]
> i want to redirect this page to not https
RewriteCond %{HTTPS} =on
RewriteCond %{REQUEST_URI} !/cv_database/cv_list.php$
RewriteRule ^(.*)$ http://www.cvbroadcaster.com/$1 [R,L]
RewriteCond %{HTTPS} =on
RewriteCond %{REQUEST_URI} !/cv_database/cv_list.php$
RewriteRule ^(.*)$ http://www.cvbroadcaster.com/$1 [R,L]
ASKER
i added in this way ..but not worked ..
it says ..redirect loop ..so it will not complete
it says ..redirect loop ..so it will not complete
RewriteEngine on
RewriteCond %{HTTPS} =off
# exclude /cv_database/cv_list.php
RewriteCond %{REQUEST_URI} !=/cv_database/cv_list.php
RewriteCond %{REQUEST_URI} !=/cv_database/free_cv_database.php
RewriteCond %{REQUEST_URI} !=/cv_distribution/cv_sending.php
RewriteRule ^(.*)$ https://www.cvbroadcaster.com/$1 [R,L]
# https://www.cvbroadcaster.com/cv_database/cv_list.php --> http://www.cvbroadcaster.com/cv_database/cv_list.php
RewriteCond %{HTTPS} =on
RewriteRule ^(cv_database/cv_list\.php)$ http://www.cvbroadcaster.com/$1 [R,L]
RewriteRule ^(cv_database/free_cv_database\.php)$ http://www.cvbroadcaster.com/$1 [R]
RewriteRule ^(cv_distribution/cv_sending\.php)$ http://www.cvbroadcaster.com/$1 [R]
ASKER
this is my all .htaccess file ... please look at that
# -FrontPage-
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
RewriteEngine On
RewriteRule ^cv_broadcasting\.html$ /cv_broadcasting.php
RewriteEngine on
RewriteCond %{HTTPS} =off
# exclude /cv_database/cv_list.php
RewriteCond %{REQUEST_URI} !=/cv_database/cv_list.php
RewriteCond %{REQUEST_URI} !=/cv_database/free_cv_database.php
RewriteCond %{REQUEST_URI} !=/cv_distribution/cv_sending.php
RewriteRule ^(.*)$ https://www.cvbroadcaster.com/$1 [R,L]
# https://www.cvbroadcaster.com/cv_database/cv_list.php --> http://www.cvbroadcaster.com/cv_database/cv_list.php
RewriteCond %{HTTPS} =on
RewriteRule ^(cv_database/cv_list\.php)$ http://www.cvbroadcaster.com/$1 [R,L]
#RewriteRule ^(cv_database/free_cv_database\.php)$ http://www.cvbroadcaster.com/$1 [R]
#RewriteRule ^(cv_distribution/cv_sending\.php)$ http://www.cvbroadcaster.com/$1 [R]
#RewriteCond %{SERVER_PORT} !^443$
#RewriteRule ^(.*)$ https://www.cvbroadcaster.com/$1 [R]
AddType x-mapp-php5 .php
ErrorDocument 400 error400.html
ErrorDocument 403 error403.html
ErrorDocument 404 error404.html
ErrorDocument 500 error500.html
change the last one into
RewriteCond %{HTTPS} =on
RewriteRule ^(cv_database/cv_(list|database|sending)\.php)$ http://www.cvbroadcaster.com/$1 [R,L]
ASKER
i have 2 files in a cv_database folder and one in cv_distribution folder .
RewriteEngine on
RewriteCond %{HTTPS} =off
# exclude /cv_database/cv_list.php
RewriteCond %{REQUEST_URI} !=/cv_database/cv_list.php
RewriteCond %{REQUEST_URI} !=/cv_database/free_cv_database.php
RewriteCond %{REQUEST_URI} !=/cv_distribution/cv_sending.php
RewriteRule ^(.*)$ https://www.cvbroadcaster.com/$1 [R,L]
# https://www.cvbroadcaster.com/cv_database/cv_list.php --> http://www.cvbroadcaster.com/cv_database/cv_list.php
RewriteCond %{HTTPS} =on
RewriteRule ^(cv_database/cv_list\.php)$ http://www.cvbroadcaster.com/$1 [R,L]
RewriteRule ^(cv_database/free_cv_database\.php)$ http://www.cvbroadcaster.com/$1 [R]
RewriteRule ^(cv_distribution/cv_sending\.php)$ http://www.cvbroadcaster.com/$1 [R]
ASKER
hey
its working ....i made the change ..below is the code
but can u tell me why following was not working ?
RewriteRule ^(cv_database/cv_list\.php )$ http://www.cvbroadcaster.com/$1 [R,L]
RewriteRule ^(cv_database/free_cv_data base\.php) $ http://www.cvbroadcaster.com/$1 [R]
RewriteRule ^(cv_distribution/cv_sendi ng\.php)$ http://www.cvbroadcaster.com/$1 [R]
its working ....i made the change ..below is the code
but can u tell me why following was not working ?
RewriteRule ^(cv_database/cv_list\.php
RewriteRule ^(cv_database/free_cv_data
RewriteRule ^(cv_distribution/cv_sendi
RewriteRule ^(cv_(database|distribution)/cv_(list|database|sending)\.php)$ http://www.cvbroadcaster.com/$1 [R,L]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Add anoter condition to the first rule in order to prevent a redirect to https
Open in new window