I am new to php. My .htaccess file is below
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>
With this the following url formats are working fine
/?qa=123/why-do-birds-sing/?qa=123&qa_1=why-do-birds-sing/index.php?qa=123&qa_1=why-do-birds-sing
But i want to make in to the below format
site.com/123/why-do-birds-sing
I tried adding the below line
RewriteRule ^.*$ index.php/qa-rewrite=$0&%{QUERY_STRING} [L]
But the site.com/123/why-do-birds-sing is not working. What changes should i make to get the desired url format working?
P.S site.com/index.php/123/why-do-birds-sing is working, but i want to rewrite without index.php
site.com/123/why-do-birds-singworks for me using above rule. What error are you getting?site.com/index.php/123/why-do-birds-sing.htaccessis enabled or not, by putting same garbage (random) text on top of your.htaccessand see if it generates 500 (internal server) error or not when you visit your page in browser?