i have made .htaccess 301 redirect reirect non www www, working fine pretty url lost when page accessed non www url.
i have done way.
options +followsymlinks rewriteengine on rewritecond %{http_host} ^site.com [nc] rewriterule ^(.*)$ http://www.site.com/$1 [r=301,nc] rewriterule ^([^/]*)/(.*\.html) process/?category=$1&link=$2 [l]
it redirects url
http://www.site.com/software/page.html
to
http://www.site.com/process/index.php?category=software&link=page.html
properly without loosing pretty url www.site.com/software/page.html
in address bar.
it redirects url
http://site.com/software/page.html
to
http://www.site.com/process/index.php?category=software&link=page.html
properly , pretty url lost , address in address bar is
http://www.site.com/process/index.php?category=software&link=page.html
instead of
http://site.com/software/page.html
how keep pretty url when page accessed without www.
please see , suggest way this.
thanks
i believe problem missing l
flag in first rule. try code:
options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase / rewritecond %{http_host} ^site\.com$ [nc] rewriterule ^(.*)$ http://www.site.com/$1 [r=301,nc,l] rewriterule ^([^/]+)/([^.]+\.html)$ /process/?category=$1&link=$2 [qsa,l,nc]
Comments
Post a Comment