Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
1.0k views
in Q2A Core by
retagged by
Now i have standart path for all questions: "id/question"

I would like turn it to "question-title/id"

How can i do it?
Q2A version: 1.5

1 Answer

0 votes
by
So, I get the key, but it work not really I want.

If you would try to rewrite .htaccess file, or couple of functions in the qa_base.php file, you would discover that it change line in browser, but the question you expected to see on this page are not exist.
That's why I dug deeper, and decided to rewrite some lines in index.php file.
I did next:

$requestzero=array_slice(explode('-', urldecode($origpath)), -count($requestzero));
                    $requestparts = array_reverse($requestzero);
                 
and comment this line  // $requestparts=array_slice(explode('/', urldecode($origpath)), -count($requestparts));
So, now questions is reacheble on those adresses I need, BUUUT

links to other pages don't work.
I think if easy to fix, if apply if elde to previose code. But I cannot to see what write after if. How to explane that first lines mast be applied to post which type is a question?
...