I want my php file not to be visible in the html document and to put another word instead 56/5000 I want to write another name instead of writing the name of my php file
Asked
Active
Viewed 39 times
-3
-
You can use [url re-writting](https://stackoverflow.com/questions/16388959/url-rewriting-with-php) to display some thing different in `html`. – Umair Khan Jul 31 '20 at 07:08
-
you can create a [rewrite rule](https://httpd.apache.org/docs/current/mod/mod_rewrite.html) to help – Professor Abronsius Jul 31 '20 at 07:09
2 Answers
1
You will need to use URL re-writing.
On Apache Digital Ocean Article:
RewriteEngine on
RewriteRule ^about$ about.html [NC]
will route:
http://your_server_ip/about
, because of the rule definition.http://your_server_ip/About
, because the rule is case insensitive.http://your_server_ip/about.html
, because original proper filename will always work.
But I strongly suggest that you stay away from it as much as is possible. Instead, start using a framework like Laravel, Codeigniter etc. Then you can name your Controller/action anything and would not have to write complex URL re-write rules.

Shammi Shailaj
- 445
- 5
- 14
0
This is not possible. A href can’t be hidden from a link. But the files can be rewritten and the request URL can be changed to look like this − login.php/5001
Other than this, a post request can be used in the below way −
<form method="post" action="login.php">
<input type="hidden" name="userinfo" value="5001">
<button type="submit">Log in</button>
</form>
This will expose a single button in the browser.

kingkong.js
- 659
- 4
- 14