Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.