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
Post a Comment