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

Hello.

How to change the standard link 

`site.org/58020/how-to-replace-spa` to 

`site.org/58020-how-to-replace-spa` on the site.

id/prettyurl to id-prettyurl

Q2A version: 1.8.8
by
edited by
Maybe, Any ideas?

1 Answer

0 votes
by

qa-base.php

Change:

case QA_URL_FORMAT_NEAT:

            $url .= $requestpath;

            break;

To:

                        case QA_URL_FORMAT_NEAT:

                                if(preg_match('/^[0-9]+\/[-a-z]+$/',$requestpath)) {

                                        $up = explode('/',$requestpath);

                                        $no = $up[0];

                                        $title= $up[1];

                                        $url.= $no.'-'.$title;

                                }

                                else $url.= $requestpath;

                                break;;

OMG: Anyway `../id/title` work, but `../id-title` is Page not found

Need only for `question` pages in url change `../id/title` to `../id-title`

...