Question

I am having trouble with the RewriteRule. I have created a pretty URL for my search page where it posts to itself to query the results. However the $_GET['type'] variable is not being sent to the page. This works perfectly fine on my local WAMP server but does not return a result on my Live hosted server.

e.g. http://..com/search/searchType/ SearchType being the $_GET['type'] data I am sending to the page.

My .HTACCESS is as follows

RewriteEngine On
RewriteRule ^property/(.*)/(.*)/([0-9]+)/$ view_property.php?type=$1&id=$3 [L]
RewriteRule ^search/(.*)/ search.php?type=$1 [L]
Was it helpful?

Solution

The problem is because there is a conflict with the file name search.php, which broke the RewriteRule which started with the text 'search'.

After discovering this and doing more research I found that including Options -MultiViews which disables the mod_negotiation MultiViews.

This must have been enabled on my Live hosted server and disabled on my local host. I will find out and update shortly.

Another fix is to rename the RewriteRule URL to something other than ^search/ or any other name that currently exists as another file to remove this conflict.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top