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

my q2a site is already set to domain.com

returning visitor who type www.domain.com on browser can't use facebook login, because during regitration on fb ap its set to http://domain.com without www.

If you go to www.perezhilton.com you will notice it direct to perezhilton.com
i want to do the same thing. 

this is my current htaccess

 

DirectoryIndex index.php
RewriteEngine On
#RewriteBase /your-sub-directory
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]

I tried changing with htaccess below, mainpage working, but url post not working with 404 error.

 

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]


anybody know, how to do this?

thanks

1 Answer

+2 votes
by
Did you delete the first set of lines? I think it should be:

DirectoryIndex index.php
RewriteEngine On

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

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]
...