Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
1.2k views
in Q2A Core by
edited by
Google keeps increasing in errors. When I click the error reported I have the following

 

http://domain.com/index.php?qa-rewrite=questions/random

htaccess is not working correctly.

 

Please advise
Q2A version: 1.5.1

1 Answer

0 votes
by

"htaccess is not working correctly."

What is the content of your htaccess, please post it.

by
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]
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
</IfModule>
SetEnvIfNoCase User-Agent "^libwww-perl*" block_bad_bots
Deny from env=block_bad_bots
by
I guess it is because I am forcing www. on my domain...
by
I removed the force www. that did not fix it.
by
I set default htaccess

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>

same issue. The site works. if you click a link within the website the rewrite works. Just not working from google...
by
I ended up over writing everything with 1.5.2 and everything seems to work... same htaccess file as listed way above.. Thanks, sometimes we just have to talk it out with others to figure out a solution.
by
compare htaccess of 1.5.2 to 1.5.1 if there are any changes...

This is my htaccess that works (1.5.1):

DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
# Rewrite all domains to one domain
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.gute-mathe-fragen\.de [NC]
RewriteRule (.*) http://www.gute-mathe-fragen.de/$1 [R=301,L]
# Rewrite for neat URLs
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>
by
Thank you for your time.
...