Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
879 views
in Q2A Core by

I would suggest to enhance .htaccess a little bit.
My proposition:

 

# The following IF prevents "Error 500; Internal Server Error" if the server doesn't support rewriteBase.
<IfModule mod_rewrite.c>
AddType x-mapp-php5 .php
#AddHandler application/x-httpd-php5 .php
DirectoryIndex index.php
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>
 
As long as RewriteBase should have always / as a value (even if the script is placed in some subfolder), "your-sub-folder" can be dropped.
 
Any more suggestions / upgrades ?

 

Q2A version: 1.5

1 Answer

0 votes
by
Thanks for the suggestion. I will add the <IfModule...> wrapper for 1.5 beta 2, but RewriteBase should remain commented out by default, since it can break the .htaccess if the Q2A site is in a subdirectory. Also I am cautious about adding AddType/AddHandler directives because this doesn't seem to be an issue for anyone, and it could interfere with the Apache configuration.
by
Okay. However, it is misleading to have "# RewriteBase /your-sub-folder" instead of "# RewriteBase /' - because only the second option will work both when the webside is placed in a rootfolder OR in a subfolder.

(I had such an experience. Maybe in some cases "your-sub-folder" would be needed, but I didn't find them).
by
Yes, you're right about that. Now it will be only: #RewriteBase /
...