PHP mod rewrite.htaccess file godaddy.com question

I'm new to PHP and I tried to learn mod rewrite to rewrite my urls. I use godaddy as my hosting company and they say to add the desired code to the body of your .htaccess file. How do I rewrite my mod URL and add it to my .htaccess file?

Can someone give me an example of how to do this, as well as tell me a good tutorial and a book on how to mod rewrite my URLs?

+4
source share
1 answer

http://articles.sitepoint.com/article/guide-url-rewriting

Note, however, goDaddy usually requires a RewriteBase /

Quick n dirty

 RewriteEngine On RewriteBase / RewriteRule ^/?about/?$ about.php [L,NC,QSA] # domain.com/about is sent to the server as domain.com/about.php RewriteRule ^/products/([0-9]+)$ /products.php?id=$1 [L,NC,QSA] # domain.com/products/23 is sent to the server as domain.com/products.php?id=23 
+3
source

Source: https://habr.com/ru/post/1310821/


All Articles