Reputation: 2403
This is the html code:
<html>
<head>
<title>Test page</title>
</head>
<body>
<form action="modules/registration/registration.php" method="POST">
<input type="submit" />
</form>
</body>
</html>
This is the registration.php code:
<?php
echo "<p>Registration is completed!</p>";
?>
If I push button all works as i need. But i wouldn't like show the internal folder structure. In browser search field it looks like on the picture below.
I would like that in the browser search field the reference looks like following:
This is the folder structure:
How can I do this? Thank you for any help.
Upvotes: 0
Views: 63
Reputation: 358
Using htaccess you can Rewrite
the URL to delete folder url and show only registration.php.
.htaccess file
RewriteEngine on
RewriteCond %{REQUEST_URI} !^modules/registration/
RewriteRule ^(.*)$ modules/registration/$1 [L]
So the result will be
myurl.com/registration.php
Upvotes: 1
Reputation: 27364
You can do this using .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^registration.php modules/registration/registration.php
</IfModule>
Upvotes: 1