I want to hide the URL of my PHP page; that is, I don't want to write /register.php
directly in the href tag, I want to write /register/
and have it open the register.php
page directly. I want to do that for all the webpages.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
In .htaccess try this :
umm quick fix is to make a directory called register and save it as the index.php then make sure all your forms have
action="/register/"
(assuming register is a root folder of domain)Rest easy .. I am new to web development also and I had trouble making this solution work. The detail that is not obvious is that in the php code links, you should remove the extension. For example :
<li><a href="index.php">Home</a></li> should read <li><a href="index">Home</a></li>
Then the extension goes away.
You should take a look at mod_rewrite; it's a Apache module that will help you with it.