php - Getting Value and redirect with htaccess -


i want redirect http://example.com/search/search.php?q=videos http://example.com/search/videos

i tried not work. here htaccess file: http://example.com/search/.htaccess

<files .htaccess> order allow,deny </files>  options +followsymlinks rewriteengine on rewritebase /search/  rewriterule ^([^/]+)(?:/[^/]+)?/?$ search.php?q=$1 [l,qsa]  rewriterule ^([^/]+)/[^/]+/([0-9]+)/?$ search.php?q=$1&p=$2 [l,qsa]  rewriterule ^search/(.*)$ load.php?q=$1 [l] 

last rewriterule not work.. how fix it.. that.. rewriterule ^search/(.*)$ load.php?q=$1 [l]

use code in /search/.htaccess:

options +followsymlinks -multiviews rewriteengine on rewritebase /search/  rewritecond %{the_request} /search\.php\?q=([^\s&]+) [nc] rewriterule ^ %1? [r=301,l,ne]  rewritecond %{request_filename} -d [or] rewritecond %{request_filename} -f rewriterule ^ - [l]  rewriterule ^([^/]+)/?$ search.php?q=$1 [l,qsa]  rewriterule ^[^/]+/([0-9]+)/?$ search.php?q=$1&p=$2 [l,qsa] 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -