php - HTACCESS friendly urls with parameters 2 -
i have little problem.
redirect in .htaccess from:
domena.pl/index.php?galeria
to
domena.pl/galeria
work fine need redirect
domena.pl/index.php?galeria=inne
to
domena.pl/galeria/inne
too , give me redirect loop.
my .htaccess is:
rewriteengine on rewritebase / rewritecond %{http_host} ^domena.pl(.*) [nc] rewriterule ^(.*)$ http://www.domena.pl/$1 [r=301,l] rewritecond %{the_request} \s/+index\.php\?([^\s=]+?)\s [nc] rewriterule ^ /%1? [r=301,l,ne] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([a-z-]+)$ index.php?$1 [l,qsa] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([a-z]+)/([a-z-]+)$ index.php?$1=$2
here example of have done on site:
options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase / # external redirect /view.php?id=1 /view/id/1 rewritecond %{the_request} ^[a-z]{3,}\s/+([^.]+)\.php\?([^=]+)=([^\s&]+) [nc] rewriterule ^ /%1/%2/%3? [l,r=301] # internal forward /view/id/1 /view.php?id=1 rewriterule ^([^/]+)/([^/]+)/([^/]+)/?$ /$1.php?$2=$3 [l,qsa]
Comments
Post a Comment