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

I want to make my url complet seo friendly, currently i am getting following format

https://kodlogs.com/index.php?qa=33938&qa_1=toolchains-found-toolchains-folder-prefix-mips64el-android

I want to get rid of index.php? in all question pages , and want them to be in same format in sitemap too , how do i do this?

I have read its something to do with .htaccess file, my config is as following what should i change: 

#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]

</IfModule>

Q2A version: 1.8.2

2 Answers

–1 vote
by

Make sure you log in as admin and select the correct method of rewriting urls.

My server is Apache and here's what in my .htaccess file.

Options -Indexes
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
#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]
</IfModule>

by
Mine .htaccess file is exactly same like yours but why i am getting index.php in url what am i doing wrong?
by
I checked your site. It's okay now.
0 votes
by

Hello

Go to Admin > General > and select the first URL structure:  /123/why-do-birds-sing (requires htaccess file)  it looks like you are using the last option which is  /index.php?qa=123&qa_1=why-do-birds-sing

...