apache - Rewrite URL with .htaccess does not direct to the new URL -


i use .htaccess rewrite url

options +followsymlinks rewriteengine on rewriterule ^book/([^/]*)$ /book.php?book=$1 [nc,l] 

this works great, , if type http://www.domain.org/book/title1 in browser's address bar takes me there. when click link on index page takes me old address http://www.domain.org/book.php?book=title1

it because don't have rules redirect. have way:

options +followsymlinks rewriteengine on  rewritecond %{the_request} \s/+book\.php\?book=([^\s&]+) [nc] rewriterule ^ /book/%1? [r=302,l,ne]  rewriterule ^book/([^/]+)/?$ book.php?book=$1 [nc,l,qsa] 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

Fatal error: Call to undefined function menu_execute_active_handler() in drupal 7.9 -

python - RuntimeWarning: PyOS_InputHook is not available for interactive use of PyGTK -