-1

my project is in core PHP with some folder structure which contain views folder but I do not want to show it so I have tried a lot in htaccess but not get success

I want url structure

http://example.com/views/interest-areas.php?id=MTY=

to

http://example.com/interest-areas.php?id=MTY=

I have taken reference of LINK but still now getting expected result

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Sachin Sudhakar Sonawane
  • 1,865
  • 1
  • 22
  • 37

2 Answers2

0

You can try my below code:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^users/
RewriteRule ^(.*)$ views/$1 [L]

Here, the [L]-flag stops rewriting after this rule, preventing possible circle-reactions etc

AddWeb Solution Pvt Ltd
  • 21,025
  • 5
  • 26
  • 57
0

Try this rule in root directory,

RewriteEngine on
RewriteBase /views/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).php$ views/$1.php [QSA,L]
Abhishek Gurjar
  • 7,426
  • 10
  • 37
  • 45