0

I'm trying to remove the proxy.php file and the parameter passed to it. This is what it looks like currently.

http://localhost/stuff/proxy.php?parameter=folder01/some.file

This is the way I would like it to look.

http://localhost/stuff/folder01/some.file

For my htaccess file, I have tried the following but they do not work.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /proxy.php?parameter=$1 [L]

And this

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.+?)/?$ /proxy.php?parameter=$1 [L,QSA]

Any ideas?

12shadow12
  • 307
  • 2
  • 10

1 Answers1

0

Try it in root dir or put this in stuff directory and remove RewriteBase line.

RewriteEngine on

RewriteBase /stuff/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ proxy.php?parameter=$1 [L]
Abhishek Gurjar
  • 7,426
  • 10
  • 37
  • 45
  • This is not working for me. I tried in the root dir and in the stuff dir. Nothing changes when I visit the url. – 12shadow12 Sep 22 '16 at 03:17
  • Did you tried it in stuff directory, use this in stuff dir and remove `RewriteBase /stuff/`. – Abhishek Gurjar Sep 22 '16 at 03:20
  • I moved htaccess to the stuff dir and removed the RewriteBase. Nothing happens still, which is weird. And I do have mod_rewrite enabled – 12shadow12 Sep 22 '16 at 03:23
  • Does rewrite mod_rewrite is enabled please check http://stackoverflow.com/questions/3131236/how-do-you-enable-mod-rewrite are other rule working other than this? – Abhishek Gurjar Sep 22 '16 at 03:25
  • I have tried it on my wamp server and a production server and mod_rewrite is enabled on both, but the htaccess you posted does not work on either of them – 12shadow12 Sep 22 '16 at 03:29