Pretty URLs worked outside Concrete5 context, but not inside - help please!?
Permalink
Want I want to achieve is to 'prettify'http://www.mywebsite.com/proplist/?location=mytown&distance=3&a... so that it can be expressed ashttp://www.mywebsite.com/property/mytown/buy/...
In order to develop the mod_rewrite directives I created (on another test website - lets call ithttp://www.testsite.com) a directory below the web root called proplist (to match the proplist above) and placed a simple index.php program in there which just parsed the query string and echoed the parameters. This way I managed to get the htaccess lines below to work:
RewriteBase /proplist
RewriteRule property/([a-zA-z]+)/([a-zA-z]+)/$http://www.testsite.com/property/\/?location=$1&distance=3&... [R]
Redirect 301 /property/ http://www.testsite.com/proplist/...
However, in the context of mywebsite (as opposed to testsite) the following lines (adapted from the above) do not work as required.
# -- rewrite property search urls --
RewriteBase /proplist
RewriteCond %{REQUEST_URI} property
RewriteRule property/([a-zA-z]+)/([a-zA-z]+)/$http://www.mywebsite.com/proplist/\/?location=$1&distance=3&... [R]
#Redirect 301 /property/ %{REQUEST_FILENAME}/proplist/
RewriteBase /
# -- end rewrite property search urls --
The redirect is commented out because inclusion results in an internal error, but even then the URLhttp://www.mywebsite.com/property/mytown/buy/... is re-written tohttp://www.mywebsite.com/index.php...
not
http://www.mywebsite.com/proplist/?location=mytown&distance=3&a...
Note that on the webserver hosting mywebsite, there is no actual directory called proplist which I suspect is a key difference to testsite that makes it fail, but I do not know how to allow for that in the mod_rewrite. Pretty URLS is turned on within this implementation of Concrete5
Can anyone help?
In order to develop the mod_rewrite directives I created (on another test website - lets call ithttp://www.testsite.com) a directory below the web root called proplist (to match the proplist above) and placed a simple index.php program in there which just parsed the query string and echoed the parameters. This way I managed to get the htaccess lines below to work:
RewriteBase /proplist
RewriteRule property/([a-zA-z]+)/([a-zA-z]+)/$http://www.testsite.com/property/\/?location=$1&distance=3&... [R]
Redirect 301 /property/ http://www.testsite.com/proplist/...
However, in the context of mywebsite (as opposed to testsite) the following lines (adapted from the above) do not work as required.
# -- rewrite property search urls --
RewriteBase /proplist
RewriteCond %{REQUEST_URI} property
RewriteRule property/([a-zA-z]+)/([a-zA-z]+)/$http://www.mywebsite.com/proplist/\/?location=$1&distance=3&... [R]
#Redirect 301 /property/ %{REQUEST_FILENAME}/proplist/
RewriteBase /
# -- end rewrite property search urls --
The redirect is commented out because inclusion results in an internal error, but even then the URLhttp://www.mywebsite.com/property/mytown/buy/... is re-written tohttp://www.mywebsite.com/index.php...
not
http://www.mywebsite.com/proplist/?location=mytown&distance=3&a...
Note that on the webserver hosting mywebsite, there is no actual directory called proplist which I suspect is a key difference to testsite that makes it fail, but I do not know how to allow for that in the mod_rewrite. Pretty URLS is turned on within this implementation of Concrete5
Can anyone help?