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

I am intigrating question2answer in my site. url-http://www.examsbook.com/qa

I am facing multiple issues. 

1. i want to have clean urls. option-1 seems good candidate. But i am unable to find what changes we need to make in .htaccess file.

2. site map show 404 error http://www.examsbook.com/qa/sitemap.xml

i am unable to find any good answers. i think we need to have questions2answer more documented. 

please help

by
There is multiple issue. when we click to profile page of any user like http://www.examsbook.com/qa/user/morwal89 it also show 404 error.

2 Answers

+1 vote
by
selected by
 
Best answer

To change URL structure change the option from Admin > General URL Structue. watch this video http://tv.q2amarket.com/tutorials/question2answer-general-settings-part-2/

For sitemap.xml 404 first check either  you have that file on the path or not.

 

Try to add/replace below rule to your WordPress .htaccess

Note: change your-q2a-directory with your Q2A directory name

DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /your-q2a-directory/
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /qa/index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
</IfModule>
by
If you have other rules than replace only above rule to your existing file. I am explaining only with the default wordpress .htaccess file. You need to check further modification you have done with WP
by
Dude, this thing messup with wordpress now. other then home page know other page is loading. they go to site.com/qa/ directory. I think we have to have separate rules for wordpress and q2a
by
Thank you dude.. Fixed the issue. Please update your answer as we don't replace the  wordpress default rule. We should add the rule you suggestion in below to that.
by
when i open user prfile page User morwal89
then it show only box for activity box. It does not show user information box and user wall. And how to activate PM
0 votes
by

I fixed this issue by adding the lines in wordpress default .htaccess file. 

DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /your-q2a-directory/
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /qa/index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
</IfModule>
Note: change your-q2a-directory with your Q2A directory name
...