Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
1.3k views
in Q2A Core by

My Q2A site url is : http://techincongo.net/question/

And here is my .htaccess content :

DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
</IfModule>

When i add after </IfModule> :

RewriteCond %{HTTP_HOST} ^techincongo.net/question/ [NC]
RewriteRule ^(.*)$ http://www.techincongo.net/question/$1 [L,R=301,NC]

It doesnt redirect non-www version to www version,

Pleease help me

Q2A version: 1.7.0

1 Answer

–1 vote
by
# Rewrite all domains to one domain
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.techincongo\.net [NC]
RewriteRule (.*) http://www.techincongo.net/$1 [R=301,L]
by
It shows 404 Not Found when applying this code in the .htaccess file.
...