@declan_ritchie
There are a few different ways to rewrite your URL from index.php
to sample.php
, but one of the most common methods is to use mod_rewrite in an Apache web server. Here are the steps to do this:
Now, when you visit a URL on your website that contains index.php
, it will automatically be rewritten to sample.php
. For example, if you visit http://www.example.com/index.php
, it will be rewritten to http://www.example.com/sample.php
.
It's important to note that mod_rewrite requires the Apache web server to be properly configured, and you may need to consult your web hosting provider or server administrator to ensure that it is set up correctly. Additionally, if you have existing rules in your .htaccess
file, you may need to modify the code to work with those rules.