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

I don't like www.domain.com//?qa=123/why-do-birds-sing 

I just wanna setup url like www.domain.com/123

 

How can I successfully setup?   Thanks

Q2A version: 1.6.3

1 Answer

0 votes
by

Basically q2a offers 5 types of URLs, see options in admin/general:

 /123/why-do-birds-sing (requires htaccess file)
 /index.php/123/why-do-birds-sing
 /?qa=123/why-do-birds-sing
 /?qa=123&qa_1=why-do-birds-sing
 /index.php?qa=123&qa_1=why-do-birds-sing

To achieve what you like, you need to select the first one.

Then you override functions that generate the URLs, for instance for the question list:

    function qa_q_path_html($questionid, $title, $absolute=false, $showtype=null, $showid=null)
/*
    Return the HTML representation of the URL for $questionid - other parameters as for qa_q_path()
*/
    {
        $title = ''; // added to have no additional information in the URL
        return qa_html(qa_q_path($questionid, $title, $absolute, $showtype, $showid));
    }

Hope that helps,
Kai
 

...