I have created a facebook application which can server both http and https users. As of now, I’m using two different folders on the server on each for https and https respectively.
e.g.
http://example.com/folder
and
https://example.com/folder_secure
I personally feel that this may be unnecessary redundancy[though clueless of the workaround], is there anyway I can include code for both http and https in a single folder and set the canvas url and secure canvas url as something like
http://example.com/folder
and
https://example.com/folder
You are over-thinking this. HTTP and HTTPS are just access mechanisms, they don’t necessarily go to different places. Configure your web server to use the same directories for both protocols and you’ll be fine.
EDIT
The way a URL like
https://example.com/folder_secureis translated into a file-path on the server like/var/www/html/folderis controlled by the configuration of the web server. You’re going to have to read the manual for whatever server you’re using. If it is Apache, the variable you need is DocumentRoot.