dzhax Posted May 19, 2011 Share Posted May 19, 2011 I have the following .htaccess Options +FollowSymLinks RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^(.*)$ index.php?str=$1 [L] It works wonders for urls likehttp://www.example.com/browseworks finebut when I dohttp://www.example.com/browse?action=dothisI am unable to get the ?action=dothis...All that gets passed is browsehow can i make the following url returnex. http://www.example.com/index.php?str=browse&vars=action=dothis ex. http://www.example.com/index.php?str=browse&vars=action=dothis&action2=dothisalso Link to comment Share on other sites More sharing options...
dzhax Posted May 20, 2011 Author Share Posted May 20, 2011 I have changed my page so that it will write the followinghttp://www.example.com/browse/?action=doth...ion2=dothisalsoinstead of browse?action... Link to comment Share on other sites More sharing options...
dzhax Posted May 21, 2011 Author Share Posted May 21, 2011 any ideas? Link to comment Share on other sites More sharing options...
ckrudelux Posted June 10, 2011 Share Posted June 10, 2011 any ideas?Hope this helps even if it's some time since you posted..A debugging tip:echo $_SERVER['SCRIPT_FILENAME'] "?" $_SERVER['QUERY_STRING'];This will output the query you send to the server after the rewrite.What's wrong with your code well if you look at it you are outputing two ? where it only should be one.your output: index.php?str=browse?action=dothisif you type: http://www.example.com/browse&action=dothisyour output will be: index.php?str=browse&action=dothisI think you are after this flag [QSA] which will append the rest of your query_string so you can write like this:http://www.example.com/browse?action=dothis Link to comment Share on other sites More sharing options...
ckrudelux Posted June 10, 2011 Share Posted June 10, 2011 any ideas?Hope this helps even if it's some time since you posted..A debugging tip:echo $_SERVER['SCRIPT_FILENAME'] "?" $_SERVER['QUERY_STRING'];This will output the query you send to the server after the rewrite.What's wrong with your code well if you look at it you are outputing two ? where it only should be one.your output: index.php?str=browse?action=dothisif you type: http://www.example.com/browse&action=dothisyour output will be: index.php?str=browse&action=dothisI think you are after this flag [QSA] which will append the rest of your query_string so you can write like this:http://www.example.com/browse?action=dothis Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.