Closed Libbna closed 3 years ago
Added the base tag in a header file which is common to all the pages. Base tag is added to specify the base URL for all relative URLs in a document.
For clean URL I have to remove the query string from the URL but after rewriting the rules and conditions in the .htaccess file it is giving me internal server error.
Moved the page to the root folder and rewrite the rules for removing the query string from the URL. RewriteRule ^blog-single/([a-zA-Z0-9-/]+)$ blog-single.php?id=$1 [NC,L]
Blog-single is a page that I've moved to the root folder.
For this, you have to create a .htaccess file.
.htaccess -> provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory.
And in this file, rewrite some rules, for example, I wanted to remove the .php extension from URL so for that I wrote *RewriteRule ^(.)$ $1.php [NC,L].**
In the attached image, the extension of the page is removed.