Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
–1 vote
in Q2A Core by

Where can I find the code to change these urls on the profile page sub navigation?

/member/UserName/questions  TO   /member/UserName/posts
/member/UserName/answers    TO   /member/UserName/comments

I edited the qa-app-format.php to the following which does indeed change the strings but, I get an 404 when I go to /member/UserName/posts or /member/UserName/comments.

'posts' => array(
'label' => qa_lang_html('misc/nav_user_qs'),
'url' => qa_path_html('user/'.$handle.'/posts'),
'comments' => array(
'label' => qa_lang_html('misc/nav_user_as'),
'url' => qa_path_html('user/'.$handle.'/comments'),
Q2A version: 1.6.2
could this be done in .htaccess?

1 Answer

0 votes

I tried editing the .htaccess using some tutorials I found online, I have the following

DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule (.*)questions$ $1posts [NC,L,R]
#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]

Which does indeed rewrite from questions to posts but, also redirects to: /member/UserName/posts which gives me a 404

How can I have it just rewrite and not redirect, is this possible?