Note that there are some explanatory texts on larger screens.

plurals
  1. PORewrite url which redirects to page on webserver
    primarykey
    data
    text
    <p>I am trying to get a page with a query string to redirect to a nicer looking url then get that url and transfer it back to the original query string but without redirecting (i.e. without changing the url) At the moment I am getting a redirect loop (for obvious reasons) but I was hoping for a way to stop this.</p> <p>This is my code in my htaccess file</p> <pre><code>#rewrite search querystring #/search/'apartment'/2_bedrooms/price_0-500000/town_W4/development_18,SW5/ 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] RewriteCond %{QUERY_STRING} propertytype=([^/]+)&amp;bedrooms=([^/]+)&amp;minprice=([^/]+)&amp;maxprice=([^/]+)&amp;location=([^/]+)&amp;development=([^/]+) /search/$1/$2_bedrooms/price_$3-$4/town_$5/development_$6 [R,L] RewriteRule ^(.*)$ /search/%1/%2_bedrooms/price_%3-%4/town_%5/development_%6? [R,L] </code></pre> <p>So what it is meant to do is: user has been taken to:</p> <p><a href="http://www.domain.com/search/?propertytype=dev&amp;bedrooms=2&amp;minprice=0&amp;maxprice=10000000&amp;location=W1&amp;development=W1" rel="nofollow">http://www.domain.com/search/?propertytype=dev&amp;bedrooms=2&amp;minprice=0&amp;maxprice=10000000&amp;location=W1&amp;development=W1</a></p> <p>This page is the actual page on the server where the data is coming from, however I want the user to see.</p> <p><a href="http://www.domain.com/search/dev/2_bedrooms/price_0-10000000/town_W1/development_W1/" rel="nofollow">http://www.domain.com/search/dev/2_bedrooms/price_0-10000000/town_W1/development_W1/</a></p> <p>Is it possible to do this without a redirect loop. <br /> Thanks for your help</p> <p><strong>EDIT</strong> I'm thinking it could be done with the rewrite flags but I'm not sure, I'm quite new to the Rewrite Engine</p>
    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.
 

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