samedi 19 septembre 2020

How to debug, test php? How to test html with .html removed (.htaccess)?

I'm wondering how professional web developers debug, test, and deploy websites with some specific questions.

#1 PHP

For a big site like amazon.com, I imagine they don't upload to the server to test php code. So how do they do it?

Is there a software or IDE I could use to test php locally?

#2 debugging without .html .php extension?

In addition, most sites remove .html and .php in url I'm also doing this by editing .htaccess

# remove .html .php
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]

But when I do this, I need to reference other html and php files without adding the extension

<a href="about">About</a>
<a href="contact">Contact</a>

So then I can't debug locally, since links won't work without uploading

How can I debug locally with this specific .htaccess?

How do other sites do it?

Any tips or general practices on website debugging, deployment, and testing would be appreciated.

Aucun commentaire:

Enregistrer un commentaire