france greatBritain


work web
information site vitrine code contact html5 css3 javascript php sql htaccess vsCode github

Hypertext Access

What to say about .htaccess ?

   I can still send you on wikipedia. Otherwise among some links that I was able to find, there is this one.

   I have almost never used .htaccess.

   I had already managed to transfer all my HTTP web pages to HTTPS.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

   I also managed Error 404. Seems that it's always a little bit more classy.
ErrorDocument 404 /IndexSite2/error.html
   'IndexSite2' corresponds to my folder on which I am currently reworking my site on vsCode before sending it to the web at the time of writing. Not said it's the latest version (I'm already at the 11th).

   Otherwise, what I'm writing for now in my file is page name changes. I've already heard that it's better if the web page doesn't end up by .html or by .php either because it does not bring anything to the content either because some words do not really have any use either for the user or for search engines. It's like this:
Options +FollowSymlinks
RewriteEngine on

RewriteRule web$ web.php [L]
RewriteRule index$ index.php [L]
RewriteRule test$ test.php [L]

RewriteRule contact$ workFR/contact.php [L]
RewriteRule code$ workFR/code.php [L]
RewriteRule site-vitrine$ workFR/site-vitrine.php [L]
RewriteRule html5$ workFR/html5.php [L]
RewriteRule css3$ workFR/css3.php [L]
RewriteRule css3withoutCss$ workFR/css3withoutCss.php [L]
RewriteRule javascriptJS$ workFR/javascriptJS.php [L]
RewriteRule hypertextPreprocessor$ workFR/hypertextPreprocessor.php [L]
RewriteRule sql$ workFR/sql.php [L]
RewriteRule htaccess$ workFR/htaccess.php [L]
   Finally, to return to the name change. It's not that simple. I mean the code itself, once you find it, doesn't pose any difficulties. The problem lies elsewhere.
   Well, already, I struggled to find on the net the $. In fact, I use images for illustrate my words for my site. I started by wanting to put icons because I found that it was intuitive. So I took bottomless icons that often work when it's either in.png either in .webp. I don't know why the .jpg didn't pass. In short, I come back to the subject.
  So, if I don't put the $ for the rewriting of my 'web.php' page, all my images .webp are destroyed.   Nor can we put the same name to the folder and the file it contains. All crash. Do not create a "plop.html" file in a "plop" folder and want to redirect the page to "plop".   But this is also valid for a 'javascript.php' file that is not located in the 'javascript' folder but with when even the existence of a 'javascript' file for my JS scripts. That's why I renamed my file 'javascriptJS.php'.   It is also not possible to redirect my "hypertextPreprocessor.php" page to "php". There, I bug all the pages (because that I work with php).

  I have not yet studied .htaccess properly. I will read the doc'. I haven't yet understood everything I've written or copied and pasted.