Jump to content

Simple mod rewrite woes :(


Drongo_III

Recommended Posts

Hi Guys

 

I hardly ever touch mod rewrite so I am stuck on something very simple.

 

I am using a htaccess file and mod rewrite so that if someone targets a particular url (which is acutally a directory) they will be served a specific file in the directory but the new url will have a query string defining where they came from.

 

So can anyone tell me why this doesn't work please?

 

RewriteEngine On
RewriteRule /tester http://localhost/HTACCESS/tester/tester.php?source=google

 

As i said, the goal is if someone hits up my site on the directory '/tester' I want them to be servered a specific file in that directory - i.e. tester.php with a query string.

 

What am i doing wrong? :(

 

Oh and incidentally when i say it 'doesn't work' specifically I am just getting the directory listing for the 'tester' directory.

Link to comment
https://forums.phpfreaks.com/topic/268346-simple-mod-rewrite-woes/
Share on other sites

  • 2 weeks later...

Try:

 

Options +FollowSymlinks

 

Just before RewriteEngine On.

 

+FollowSymLinks must be enabled for any rules to work, this is a security requirement of the rewrite engine. Normally it's enabled in the root and you shouldn't have to add it, but it doesn't hurt to do so.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.