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
yes. i installed that plugin available available in Q2A. so it should not show any error..
Still i am not able to find solution for this.
As alternative u can suggest how i can install a site map.
by
As i understand, when ever we have any url other then site.com/qa/index.php?xyz
like http://www.examsbook.com/qa/user/morwal89 then we get 404.
I guess it have something to do with .htaccess file.
by
I think you are running Q2A with WordPress SSO??? and your Q2A is in sub directory of the WordPress like www.yourwpsite.com/q2a

You may need to update your WordPress .htaccess file. Try to search here in my answer I have already given answer for that somewhere.
by
ya.. i am setting up with wordpress. and in subdirectory as http://www.examsbook.com/qa/ .  i understand there wud be changes in .htaccess file. that video show nothing. what are the changes i need to make
by
I visited and watch all videos and read blogs on your site. No information at all about this issue. Sir please help.
by
check my modified answer..
by
should i edit .htaccess  file wordpress or in q2afolder.
by
If WP is the main site on the root like www.wpsite.com and q2a is in sub directory like www.wpsite.com/q2a than you should add above rule to WordPress .htaccess file. Before you replace existing, take backup. than replace this rule with existing.
by
Ok. i will try. Hope it will not break anything in wordpress. .htacces file of wordpress have lots of other rules for browser caching
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
...