Welcome to the Question2Answer Q&A. There's also a
demo
if you just want to try it out.
Login
Login
Register
All Activity
Questions
Hot!
Unanswered
Tags
Users
Ask a Question
About
Wiki
Welcome to the Q&A for
Question2Answer
.
If you have questions about the platform,
click here to ask
and please use English.
If you just want to try Q2A, please use the
demo
, which also grants admin access.
Apr 29:
Q2A 1.5.2
Related questions
How to redirect www.domain.com to domain.com like perezhilton.com?
Problem on clicking header or logo (index.php)
Freeze on install domain.com/index.php?qa=install issue still open?
does Question2Answer work on Yahoo without .htaccess upload?
What is wrong with my installation of Q&A site. Type www.askifa.co.uk; The Q&A index pages are not showing
Problem with .htaccess file
Translating questions and ask from link
Doesn't Anyone Know Something about 301 Redirects and This Script????
How to I get the Facebook Authentication Plugin to work with example.com and www.example.com?
How to redirect non www to www without breaking any link structure in Q2A?
All categories
Q2A Core
(3,252)
Plugins
(356)
Google index with www and without
+2
votes
Hi,
is this a duplicate content problem? What I have to write in htaccess to prevent google from indexing
http://domain.com
and
http://domain.com
I want only
http://domain.com
At the moment, the htaccess looks as follows:
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]
htaccess
asked
Nov 24, 2010
in
Q2A Core
by
anonymous
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1 Answer
+1
vote
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
answered
Nov 25, 2010
by
Frank Basti
thanks Frank. So this is to prevent google from indexing the www.domain.com? Doesnt clash with other rules? Cheers
It does a 301 redirect from the www version to non-www. It should be fine on its own and not conflict with other rules.
Please
log in
or
register
to add a comment.