Api-php


http://localhost/htaccess-clean-urls/parameter_letter_and_number.php?param=post&m2=143
http://localhost/htaccess-clean-urls/post/143
RewriteRule ^([a-z]+)\/([0-9]+)\/?$ parameter_letter_and_number.php?param=$1&param2=$2 [NC]

http://localhost/htaccess-clean-urls/login.php
http://localhost/htaccess-clean-urls/register.php
http://localhost/htaccess-clean-urls/login/
http://localhost/htaccess-clean-urls/register/
RewriteRule ^([a-z]+)\/?$ $1.php [NC]

http://localhost/htaccess-clean-urls/parameter_number.php?param=5254
http://localhost/htaccess-clean-urls/5254/
RewriteRule ^([0-9]+)\/?$ parameter_number.php?param=$1 [NC]

http://localhost/htaccess-clean-urls/parameter_number_and_underscore.php?param=143_5254
http://localhost/htaccess-clean-urls/143_5254/
RewriteRule ^([0-9_]+)\/?$ parameter_number_and_underscore.php?param=$1 [NC]

php https redirect


// https redirect

if (! isset($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off' ) {
    $redirect_url = "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    header("Location: $redirect_url");
    exit();
}