PHP - Rewrite Www To Https Problem
Hello I have problem on redirecting the site to https when it comes to "www.site.com".
I made this
<rules> <rule name="Redirect site.com to www" patternSyntax="Wildcard" stopProcessing="true"> <match url="*" /> <conditions> <add input="{HTTP_HOST}" pattern="site.co" /> </conditions> <action type="Redirect" url="https://www.site.co/{R:0}" /> </rule> </rules>In this sample when I try to access the site through "site.com" it redirect to " https://www.site.com " but when I access the site to www.site.com the https doesn't appear. Similar TutorialsThis topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=359577.0 Hello,
I cannot work out this one.
I am loading a css file on an https page as:
<link rel="stylesheet" type="text/css" href="/assets/fa687e60/jui/css/base/jquery-ui.css" />
But using the chrome element tool I see this error:
The page at 'https://mysite.com/deal/create' was loaded over HTTPS, but displayed insecure content from 'http://mysite.com/cs...bf9ee_1x400.png': this content should also be loaded over HTTPS.
Now I went in the css file and the code is like that:
.ui-state-highlight, .ui-widget-content .ui-state-highlight, (Trying to get my brain back into this old problem which I fixed but want to re-code a better way...) So I was having problems with getting some browser error when people would go to checkout because the page logo was coming from an HTTP source and the page was an HTTPS page. I created a "config" file and had this code... Code: [Select] <?php define('ENVIRONMENT', 'development'); //define('ENVIRONMENT', 'production'); // Secure Web Server Root define('SECURE_WEB_ROOT', ENVIRONMENT === 'development' ? 'http://local.dev3/' : 'https://www.mysite.com/'); ?> Then in my page I had... Code: [Select] <div id="header"> <a href="<?php echo WEB_ROOT ?>index.php"> <img id="logo" src="<?php echo SECURE_WEB_ROOT ?>images/mylogo_200x50.png" width="200" alt="My Logo" /> </a> </div> Is there a better way to do this and eliminate my Config file which is no longer needed since I learned how to create a "Virtual Server"? Debbie Hi im a newbie php developer and am experiencing two problems at the moment. The first and most important is that google charts can not save over https i have copied a function that should save the file but i am clueless as to how it work s and where i am going wrong with it ??? any help with this would be greatly appreciated. Secondly every time i hit submit the page first posts data and then i have to submit again before it posts the data to google charts api ? Again any help would be greatly appreciated Thanks in advance ill add all the code here for you guys. Saving the google chart api function saveImage($chart_url,$path,$file_name) { if ( (!file_exists($path.$filename)) || (md5_file($path.$filename) != md5_file($chart_url)) ) { file_put_contents($path.$filename,file_get_contents($chat_url)); } return($filename); } function doSomething() { $local_image_path ="home/sean/img/charts/"; $imagename="some_chart_image.png"; $chart_url = $chartimage; $image = saveImage($chart_url ,$local_image_path,$image_name); echo "Image Saved"; } $body .= "<table class='formTABLE'> <tr> <TD class='FieldCaptionTD' align='right' colspan='2'> <input class='Button' method='post' action='' align='right' type='submit' name='save_file' value='Save'> <input class='Button' method='post' action='' align='right' type='submit' name='submit_button' value='Submit'> </center> </TD> </tr> </table>"; $body .= htmlmaintsplit(); ?> <img src="/home/sean/work/some_chart_image.png" alt="" /> How am i to use this now to save the graph i have created ??? Relating to the submit button problem - this is set after the submit button though i have tried placing the submit button beneath this code but still the same problem persists <form action='<?php echo $action?>' method='POST' name='bargraph' value='bargraph' chid='post_form' onsubmit="this.action = 'http://chart.apis.google.com/chart?chid=' + (new Date()).getMilliseconds(); return true;"> This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=326189.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=325281.0 so i have a number of websites on a server all work fine but when i put https://
in front of the other sites on the website's it redirects to another site on the server without changing domain name.
example:
http://www.example.com
works fine
https://www.example.com
shows another site on the server
how can i stop this?
i tryed mod rewrites in htaccess but somehow isnt working?
I want to rewrite this url
site.come/info.php?country=america&state=colorado&city=denver I am having trouble rewriting a url, I have taken on a project that to rebuild a site that is over 7 years old and the current url structure is "http://www.mysite.com/?page=home" this i find crazy who uses "?page=" anyway am now creating the site again using a better structure of http://www.mysite.com/home.htm my problem is that the owner of the site has good google results with the current urls but wants them changing, and for the old ones to work too, i am trying to do this with .htaccess but the "?" in the url is causing massive problems with internal server errors. can anyone help me please it driving me nuts. Thanks in advance hello friends, that would help me alot , if i've 2 code all are of if and else code 1 $r = $_SERVER['HTTP_REFERER']; if (stripos($r, $refere) !== false) { echo "good"; }else{ echo "bad"; } code 2 if($line[hits] >= $limited){ echo "bad"; }else{ echo "good"; } both are 2 codes where the user should pass before it show good how then it be 1 code not 2 ( if x if y else y2 else x2 ) it like double sandwich I'm trying to determine the best way to provide HTTPS access to a web application that I'm building. I know that you can use the following code to redirect anyone manually accessing the http version of an https page: Code: [Select] if($_SERVER["HTTPS"] != "on") { header("HTTP/1.1 301 Moved Permanently"); header("Location: "https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]); exit(); } I have also heard that you could use mod_rewrite in Apache to achieve similar results. The entire web application should use https so I just want to make sure that I'm setting this up correctly. Feedback on the best approach or other suggestions would be very helpful. Thanks in advance. Anyone know how to force URL with SSL with www.
<rewrite> <rules> <rule name="Redirect to HTTPS" stopProcessing="true"> <match url="(.*)" /> <conditions><add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="https://www.site.com/{R:0}" redirectType="SeeOther" /> </rule> </rules> </rewrite>Please check the sample. This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=333344.0 Hello friends, If i've link as following myownsite.000/index.php?r=5774 and i want to convert it to be myownsite.000/5774 i've tried .htaccess Code: [Select] RewriteRule (.*)\ index.php?r=$1 but didn't worked ! can anyone write it thanks This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=346275.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=332483.0 Hi Guys, I no its only a partial PHP question but its still related to PHP... I have a URL .com/sites/0.php?Ter=144 and it takes you to a page and loads details with the id (ter) equalling 144 and displays all of 144's information... normal PHP stuff However I want to be able to put a Rewrite rule using a .htaccess (unless there is a better method!?) to get search engine frienly results. However I dont want the user to type .com/144 to bring up the Leeds branch. I want them to type .com/leeds and it bring up 144 (Leeds Branch). BranchName is the field I use for the branch name in my MySQL table. Is this possible? Also when I enter .com/sites/0.php?BranchName=Leeds that doesnt work either... Cheers, Sam Say my URL is http://www.example.com/catalog.php?category=hats&prodID=53 and I use Mod-rewrite to make it http://www.example.com/catalog/hats/53/ Can I still use $_GET['category'] to get the parameters? If so, how? Hi, I've a problem modifying the code which send parallel requests to get the status from getstatuses().I've two functions say public function getStatuses($idList) { } public function getid($id) { $status = array(); foreach ($id as $idList) { $status[] = $this->getStatuses($idList); } return $status; } the above getid() function sends the synchronous requests to the getstatuses() function and get the status back one after another.If you need to make 5 HTTP requests and each call takes a second, your app is delayed at least 5 seconds.Now,i want to rewrite the code(if possible two functions)that speeds up the results by sending all the requests and getting back the statuses at once.Something,other friends have developed is to reverse the getstatuses() and getid() functionality.Can anybody help me writing this code Thanks This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=325762.0 |