Codeigniter in shared ssl - codeigniter

I am not able to get codeigniter to work on my shared ssl url.
for example, on
https://nimrod.eukhosting.net/~nadavwei/myatar.co.cc/aaa
i get a 404 error
aaa is just a demo controller that should echo test
only the homepage - with no controller in the url - works
https://nimrod.eukhosting.net/~nadavwei/myatar.co.cc/
btw, i am using .htaccess
thanks

It looks like your provider is disabling .htaccess for the https server.
I am able to see your website here: https://nimrod.eukhosting.net/~nadavwei/myatar.co.cc/index.php/categories/26
But it won't work here: https://nimrod.eukhosting.net/~nadavwei/myatar.co.cc/categories/26
My guess is that their setup allows or disallows .htaccess based on the virtual domain, and since you are not using your virtual domain, it is being disabled. You should contact your hosting provider and see if they know or can provide more information.
You can also double check your .htaccess file, in case there is something about it specifying the virtual domain.
Also, as an FYI, you are going to have to modify your CodeIgniter configuration so that it dynamically the full path and turns on or off the index.php part of your URL based on whether or not the user is arriving via HTTPS:
$is_https = !empty($_SERVER['HTTPS']);
$config['base_url'] = $is_https ?
'https://nimrod.eukhosting.net/~nadavwei/myatar.co.cc/' :
'http://myatar.co.cc/';
$config['index_page'] = $is_https ? 'index.php' : '';
This should toggle the modes as necessary.

Related

How do I set a redirect for my root index.html in jekyll?

I have jekyll-redirect-from plugin, but it only really works for pages that aren't my root homepage.
For example, if a user types in www.mywebsite.com/index.html I want it to redirect and display the URL as www.mywebsite.com
Everything I can find about this is focused on blog posts and other pages than the index. Has anyone had this issue?
You don't need a redirect, because www.mywebsite.com/index.html and www.mywebsite.com are the same page. (The browser just shows the index file by default if you go to www.mywebsite.com.)
You need the browser to rewrite the URL, while remaining on the same page. You need to do this on the webserver.
.htaccess
If your site is on an Apache server and you have access to the server, you can use an .htaccess file to rewrite the URL from www.mywebsite.com/index.html to www.mywebsite.com.
There are online .htaccess generators like this one that help get the syntax right.
There are similar methods for rewriting URLs on nginx webservers.
GitHub Pages
If you're on a service like GitHub Pages, you can't use .htaccess. A free workaround is to use Netlify to deploy your site, because you can set up redirects on Netlify. Create a free account on Netlify and add a new site from GitHub there.
In the root of your repo, create a netlify.toml file containing this:
# Redirect /index.html to /
[[redirects]]
from = "/index.html"
to = "/"
Netlify will now handle that redirect.

https on TYPO3 - show via pagetree

I have a TYPO3 site now running under https. All works fine, except for clicking on Show on a page in the Page tree. I then get an invalid URL which starts like 'https://https//www.'
Steps I did:
Domain record bla.com 301 redirect to https://www.bla.com
Domain record https://www.bla.com
Force SSL backend via $GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] = 2;
Should I set something else to have correct 'Show' links from the pagetree?
thanks
Do you use the backend over SSL too? Died you try to set the url schema inside each page settings from http:// to https:// to exclude this as the error?
In tsconfig TCAdefaults.pages.url_scheme = 2 needs to be added (I already had that, but thank you Paul). But a domain record was wrong; the 2nd one needed to be entered without https://

What kind of server configuration is needed to have a laravel app working

Using cpanel I have upload into a server a laravel application. During the development I have used MAMP and it works fine.
When I upload the application into my host server, I only can see the first page:
http://myurl.com/appname/public/
When I try to navigate I always get this error:
Not Found
The requested URL /myurl.com/appname/public/account/sign-in was not found on this server.
What is the problem? Are there any special configuration for laravel applications?
Edit:
.htaccess file content:
Options -Indexes
SetEnv DEFAULT_PHP_VERSION 55
I tried to add RewriteBase /like this:
Options -Indexes
SetEnv DEFAULT_PHP_VERSION 55
RewriteBase /
But it didn't work either.
I'm using this host https://www.ecowebhosting.co.uk/?page=webhosting&tab=advanced
You didn't mention which web server you're using, but if it's apache, it looks like you need to either
Tell Apache to process .htaccess files (so it can see the rewrite rules that pass everything to index.php
Turn on the mod_rewrite module, which is the module that does the work of rewriting URLs
When you request a URL like
http://example.com/appname/public/account/sign-in
in a Laravel application, the rewrite rules turn that in
http://example.com/appname/public/index.php/account/sign-in
Behind the scenes. It looks like your server isn't setup to do this. Also, since you're serving Laravel out of a non root folder, you may need to set the RewriteBase. However, generally speaking, the ideal Laravel setup is one where the public folder is your web root. If possible, I'd configure your server so that's true as well.

How can I get an old codeigniter project to work in a subdirectory

First off, I'm not a codeigniter developer, though I've had some exposure to it and MVC in general. I inherited a project where the companies old dev had taken down their codeigniter website and replaced it with a static one page html thing. They did this by (as far as I can tell) just renaming the index.php and putting an index.html in the root.
So... I moved all the codeigniter files to a subdirectory, and renamed the index.php file appropriately
Now the homepage appears, but all internal links are broken with an internal (500) server error.
I've done a couple things to no avail:
modified the config.php base_url to include the subdir: $config['base_url'] = "http://". $_SERVER['HTTP_HOST']."/subdir/";
tried all the options for $config['uri_protocol']
Anyone have any ideas? I really just need to recover the data from the site, which I can do manually just by looking in the database and some other stuff coded directly into the views - but I'd rather just get the old site running in the subdirectory.
Is $config['index_page'] = ''; ?
Is the server running Apache? If so, what about the .htaccess rules? If so, you may need to add a RewriteBase rule, like so:
RewriteBase /subdir/
We're going off the assumption that the old dev used anchor(), base_url(), and/or site_url() correctly. If they hard-coded the links (which you shouldn't do with CI), then you'd have to write .htaccess rules to rewrite them to the new sub directory or edit the controllers/views that might be generating such links.

MVC Routing / HostHeader does not work when I use RequireHttps

I'm currently experiencing an issue whereby my MVC site is not responding correctly using IIS 6.
I've setup a url as http://mysite.co.uk which automatically redirects to the correct MVC home page. As the site contains sensitive information I have added the [RequireHttps] attribute to each controller class to automatically redirect the browser to an https url of https://mysite.co.uk which works correctly.
When I access the site as http://www.mysite.co.uk the site correctly redirects to https://www.mysite.co.uk/Default.aspx but it then responds with
Bad Request (Invalid Hostname)
It looks like any time I use www. as part of the url it fails to respond but I have a hostheader setup as www.mysite.co.uk under the IIS website. Is there anything in particular I need to do to make MVC understand the www. part of the url in terms of routing?
Thanks,
Brian.
IIS 6 doesn't add ssl host headers as you think it would. see my article at:
http://completedevelopment.blogspot.com/2009/06/multiple-host-headers-ssl-and-wcf.html

Resources