.htaccess - htacces rewrite - extend url without modifying query -


i want change:

    /?q=bla 

to

    /search?q=bla 


i have placed rule like:

    rewriterule ^search?q=(.*)$ /?q=$1 [l] 


but doesn't work, appreciate help, thanks

you can't match query string using pattern inside rewriterule. need match against %{query_string} var inside rewritecond:

rewritecond %{query_string} ^q= rewriterule ^search$ / [l,qsa] 

technically, don't need qsa flag, since query strings appended automatically.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -