Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><em>Edited</em>:</p> <p>Here is a complete (and working) solution for you:</p> <pre><code>RewriteEngine On # User gets here: # http://localhost/search/?propertytype=dev&amp;bedrooms=2&amp;minprice=0&amp;maxprice=10000000&amp;location=W1&amp;development=W1 # He is explicit redirected to here: # http://localhost/search/dev/2_bedrooms/price_0-10000000/town_W1/development_W1/ # Internally, apache calls this: # http://localhost/search.php?propertytype=dev&amp;bedrooms=2&amp;minprice=0&amp;maxprice=10000000&amp;location=W1&amp;development=W1 RewriteRule ^search/([^/]+)/([^/]+)_bedrooms/price_([^/]+)-([^/]+)/town_([^/]+)/development_([^/]+) search.php?propertytype=$1&amp;bedrooms=$2&amp;minprice=$3&amp;maxprice=$4&amp;location=$5&amp;development=$6 [NC,PT] RewriteCond %{QUERY_STRING} propertytype=([^/]+)&amp;bedrooms=([^/]+)&amp;minprice=([^/]+)&amp;maxprice=([^/]+)&amp;location=([^/]+)&amp;development=([^/]+) RewriteRule ^search/(.*)$ /search/%1/%2_bedrooms/price_%3-%4/town_%5/development_%6/? [R,L] </code></pre> <p>It assumes you put .htaccess in server root and that there is a file search.php in root too.</p> <p><em>Original:</em></p> <p>I think you can use <code>PT</code> and <code>QSA</code> Rewrite Rule flags (<a href="http://httpd.apache.org/docs/current/rewrite/flags.html" rel="nofollow">http://httpd.apache.org/docs/current/rewrite/flags.html</a>) in your first rule</p> <p>Use <code>PT</code> for server-side redirection (it will not change the URL for the user/browser, but will for your server-side scripts)</p> <p>Use <code>QSA</code> if you wanna carry the query while doing this redirection</p> <p>You can redirect all requests that don't target an existing file to a specific php-script, for example:</p> <blockquote> <p>RewriteEngine On<br> RewriteCond %{REQUEST_FILENAME} !-f<br> RewriteRule ^(.*)$ index.php?url=$1 [PT,QSA]</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload