.htaccess - Pattern Matching htaccess redirect -


i know should relatively simple having trouble , have read , tried several examples here none seem work.

i need temporarily stop 1 particular url displaying results , want instead redirect user page.

the url match on looks this:

http://www.testdomain.com/news/index.php?toptitle=big%2bend&xmlfile=http://anotherdomain/item.rss%3fkeyword%3dbig%2bend

(the url longer above more parameters)

but want if url has: toptitle=big%2bend in want redirect visitor subdirectory

here's have tried:

redirect 301 /(toptitle=big%2bend)$ /block/

then tried:

redirectmatch 301 ^/(toptitle=big%2bend)/?$ /block/

i have tried , without encoding doesn't seem working must doing wrong.

other things working in htaccess file bit stumped - appreciated.. know it's basic :-(

thanks in adavance

how about:

rewriteengine on rewritebase / rewritecond %{query_string} toptitle=big%2bend rewriterule ^(.*)$ block/? [r=301] 

this requires rewrite module enabled in main config:

loadmodule rewrite_module modules/mod_rewrite.so


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -