close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

htaccess file

Thread began 5/28/2010 2:05 pm by mrobben375515 | Last modified 10/02/2010 10:56 pm by Awemaker | 1901 views | 10 replies |

mrobben375515

htaccess file

So I added an htaccess file to my site to redirect the url to https for the secure transaction. However, now when I try to connect the database i get the error message "an unidentified error has occurred". So I realized I can only have one htaccess file, so I got rid of the one I have in the main directory to redirect the url and left the one in the _db_backups folder and tried to test the connection and it worked. So then I tried to put the url redirect code in that one and uploaded it and the site didn't redirect to the https. What am I supposed to do. If I put the db code in the htaccess of the main directory it won't connect in dw and if I put the redirect in the one in the folder it won't redirect....please help. I've attached the files. Thanks

Attached Files
htaccess.zip
Sign in to reply to this post

Eric Mittman

Does your site make use of a dedicated SSL certificate, is the https domain the same? If so then you could make use of some php to do this form you. If you add the following code to the top of any pages that you would like to automatically redirect to the https version it will redirect the user.

php:
<?php if((!(isset($_SERVER['HTTPS']))) || ($_SERVER['HTTPS'] == "") || ($_SERVER['HTTPS'] == "off"))header("Location: https://" $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']); ?>
Sign in to reply to this post

mrobben375515

I put the code in the first line of my index page to test it out, and for the first second it showed a white page with an error message and then it redirected to the index page. When the page showed up it had this error message at the top...

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/l/u/n/lunchpailbooks/html/index.php:2) in /home/content/l/u/n/lunchpailbooks/html/WA_eCart/WA_eCart_Definition_PHP.php on line 465

Sign in to reply to this post

Eric Mittman

This error almost always occurs because of a white space character outside of the php blocks on the page. Since the error is saying that the output is starting on index.php:2, this is referring to line 2 on this page. This tells me that you may have an extra space or return around this line of code on your page. If you can put the cursor next to the php block press the backspace button to see if you can remove anything without deleting the php block.

If you continue to have problems with this post back with a copy of your index page.

Sign in to reply to this post

mrobben375515

Ahh...makes sense. Thanks for the help...it works perfect now

Sign in to reply to this post

Eric Mittman

Glad to hear that. Post back with any other questions that you have and we will gladly help with whatever we can.

Sign in to reply to this post

christy342106

Redirect Back to http

I'm so glad I found this post - what a nice little bit of code! I placed the code on my ordering and checkout pages, and it does redirect as it should. If you, for example, go to "view cart" from the quick cart link the top of any of the pages, it will redirect you to the secure version. If you click a link from that page - go back to the index page, for example, all of the pages are now using https. I'm completely fine with this, other than I am concerned about my shoppers dealing with that annoying, "do you want to view only the secure content" message on every page. Is there a way to redirect the page back to the regular version if they happen to continue shopping rather than completing with the checkout process? Perhaps there is a way to prevent that warning message from my end rather than depending on the customer to change their browser settings?

This isn't a huge problem - just curious. I'm just happy to get the security working so easily! Thanks much!!

Sign in to reply to this post

Eric Mittman

Yes, you can definitely make it so the links that a customer clicks on will take them to the non secure part of the site. To do this you just need to specify the full address to the page. For example in your navigation if you use the full address for the home page like this:

index.php

This will force it to work with the regular http version of the page. The reason you are getting to secure versions of the pages after using this code is because the links are relative. This means that they will use the same protocol and port as the page they are currently on.

Sign in to reply to this post

christy342106

Ah, that totally makes sense! I should have thought it through a little more ...

Thanks for your help! You guys are always so great!!

Sign in to reply to this post

Eric Mittman

You are very welcome, and thanks for the kind words. Let us know if you have any other questions.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...