0

Thank you for taking your time to read this,

Lets say for example i have a folder called "ADMIN" and in there i have 3 files named

file1.php
file2.php
file3.php

so when i visit them it would be like this right?

http://localhost/admin/file1.php
http://localhost/admin/file2.php
http://localhost/admin/file3.php

now is there any way i can change these to

http://localhost/admin/file1/
http://localhost/admin/file2/
http://localhost/admin/file3/

i know there is a way to do this individually but i don't have 3 files in there theres more like 25 so it would be a bit of a pain.

Thanks for any help in advance.

Also as a little extra. This could be a stupid or a good question but is there any way to hide "GET" data with .htaccess for example

http://localhost/file.php?get=name

to

http://localhost/file.php 

and also the get data still work obviously.

Thanks again.

Connor

iConnor
  • 19,997
  • 14
  • 62
  • 97

1 Answers1

1

Hiding the .php extension should look something like this in your .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /admin/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9_-\.]*)?$ /admin/$1.php [L]
</IfModule>

As for GET data, can't you send those parameters as POST from your form(s)?

Goblin
  • 323
  • 1
  • 5