Kılıç Bilişim Getting the page ready

Everything is falling into place.

Your Digital Solution Partner

Technical Guide for PHP and cPanel Compatible Website

Simply plan the folder structure, routing, security and publishing process on PHP sites that do not require build.

What does cPanel compatible structure mean?

A cPanel compatible site is a structure that can work with the supported PHP version without the need for an additional compilation service on the server and can be published via the file manager. This approach makes setup easier for businesses using classic hosting.

Easy release shouldn't mean messy code. Maintenance is safer when common components, configuration files, and pages are kept in separate folders.

  • Verifying supported PHP version
  • Configuration from a single center
  • Common header and footer components
  • Disable hidden files from web access

File and route organization

Separating the URL the visitor sees from the actual PHP file on the server provides cleaner addresses. Extension-free and meaningful routes can be created with rewrite rules.

Absolute addresses or addresses calculated relative to the site root should be used in asset files. The most common reason for CSS and images to disappear when the site is running in a subfolder is incorrect relative paths.

If the base URL for the local environment and live domain is calculated automatically, the same files will work smoothly in different folders.

Pre-release security settings

In the production environment, error details should not be shown to the visitor, session cookies should be set securely and CSRF control should be used in forms. File listing should be turned off.

Database password and email information should be stored in environment variables that cannot be accessed from the web, rather than written into the code.

  • Display errors are off
  • Security headers are on
  • Validation and CSRF in forms
  • Access denied to configuration files

Release and return plan

Before transferring files, a backup of the current site and database must be made. The risk of outage is reduced when the new version is tested in a separate folder and then linked to the domain.

After publication, the form, 404 page, sitemap and sub-routes should be checked as well as the home page. One must know how to revert to the previous version in case of error.

  • File and database backup
  • PHP version and plugin control
  • SSL and orientation test
  • Form and SEO smoke test