Hi, I have following htaccess file, and I'm getting a 404 error when I try to pass variables through the URL like this. url.com/search/?sort=hits While url.com/search/ works. I tried adding ?%{QUERY_STRING} behind browse.php, but it didn't work. Any ideas? # DO NOT CHANGE THE FOLLOWING LINES # status: 1 # pattern_category: {$cat_path}/more{$page}.html # pattern_detail: detail/{$link_id}/{$link_title}.html Options -MultiViews RewriteEngine On RewriteRule ^detail/(.*)/(.*)\.html detail.php?linkid=$1 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^.* browse.php Code (markup):
try this line: RewriteRule ^detail/([a-z0-9.-]+)$/([a-z0-9.-]+)$\.html detail.php?linkid=$1 [R=301,L]
Thanks, but the problem is somewhere in the other part. RewriteRule ^.* browse.php Code (markup): browse.php is being rewritten to "search", like in the example above. And I'm having problems to pass the variables to browse.php.
Still getting the same 404 error. This is how it looks now. Options -MultiViews RewriteEngine On RewriteRule ^detail/(.*)/(.*)\.html detail.php?linkid=$1 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ browse.php [L] Code (markup):
hopeless at reading descriptions, RewriteRule ^/search/(.*)/?$ /browse.php?sort=hits&search=$1 or RewriteRule ^/search/(.*)/(.*)/?$ /browse.php?sort=$2&search=$1 or possibly something totally different if u post an actual link to the page along with how you want the urls to look that'll sort it out .....
chang the "Options -MultiViews" to -> Options +FollowSymlinks and then try remove all the rules and try testing one by one,