PHP - Moved: Linked Resources Don't Work With .htaccess Virtual Redirects. Need Elegant Sltn
This topic has been moved to mod_rewrite.
http://www.phpfreaks.com/forums/index.php?topic=347820.0 Similar TutorialsThis topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=347966.0 This one requires lots of up front information: I have a page, for this example that I will call page.php. It takes get parameters, and for this example I'll call the parameter "step". So I have a URL like this: page.php?step=1 This page has a form with an action of page.php?step=1. The code on the page validates the posting information. If the information is bad, it returns the user to page.php?step=1; if it is good, it takes the user to page.php?step=2 via header( "location:page.php?step=2" ). So redirection is done by relative path, not full URLs. This all works as expected. Now what I've done is set .htaccess to be HTTPS for this page, via this code: # Turn SSL on for payments RewriteCond %{HTTPS} off RewriteCond %{SCRIPT_FILENAME} \/page\.php [NC] RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] This works (initially). However, once you try to post the form, it just redirects back to the step=1 version of the page. I really don't know how or why that would be. I'm not sure how else I can explain this or what other information you may have. But it's frustrating to not get a page working in HTTPS that works in HTTP. Very odd. Any suggestions? (I don't even really know the best location to figure out when/why it's redirecting back to the original page.) I have create a working site at localhost but when I upload it to webhost, it's not working, all link broken.
This is the site.
this is the directory :
The index.php content is :
<?php header('location:home.html'); ?>and the .htaccess content is : RewriteEngine on RewriteRule ^home.html$ main/home.php?main=home [L] RewriteRule ^penyakit.html$ main/home.php?main=penyakit [L] RewriteRule ^review-(.*)\.html$ main/home.php?main=detilgejala&id=$1 [L] RewriteRule ^solusi.html$ main/home.php?main=solusi [L] RewriteRule ^proses$ main/home.php?main=prosessolusi [L] RewriteRule ^bukutamu.html$ main/home.php?main=bukutamu [L] RewriteRule ^send-contact$ main/main_bukutamu/proses_bukutamu.php [L] RewriteRule ^about.html$ main/home.php?main=about [L] RewriteRule ^ensiklopedia.html$ main/home.php?main=ensiklopedia [L] Options All -indexesThis config work in localhost. Thanks for your attention and respond, it help me so much and sorry for the topic's title can't edited it. Edited by havide, 31 October 2014 - 12:35 PM. This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=356252.0 This topic has been moved to Apache HTTP Server. http://www.phpfreaks.com/forums/index.php?topic=333684.0 This topic has been moved to Apache HTTP Server. http://www.phpfreaks.com/forums/index.php?topic=306351.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=314407.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=318730.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=349238.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=353241.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=321972.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=342235.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=306379.0 This topic has been moved to Apache HTTP Server. http://www.phpfreaks.com/forums/index.php?topic=342523.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=349451.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=333386.0 This topic has been rewritten to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=356324.0 (have I used that one before? I need to write these down somewhere) This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=310649.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=330095.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=323272.0 |