Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
1.8k views
in Q2A Core by
Hi how to resolve this? Is no url structure with okay sign, and why i cant to delete .htacces file? if i delete it it apears back.
Q2A version: 162

1 Answer

0 votes
by
edited by

Have you read here ?

What's the content of your .htaccess file ?

This is mine ( "fictitious" site : "www.question2answer.com" ) and it works:

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} [QSA,L]
</IfModule>
 
Inside Apache conf I've also set this directive :
 
        <Directory /my-directory-path/question2answer/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
 
 
 
by
You haven't written it explicity but I assume in my answer that you are trying to use the url structure that requires a htaccess file (/123/why-do-birds-sing) on this website : http://intreaba.filme-traduse.ro/
by
edited by
no.. I try to use on http://tuintrebi.ro. All the  q&a files i upload in public_html folder. the htadcces file  must be in public_html folder or up on the root? the htacces fle is the same with that what you writed to me. i dont know what to do with the second code. i have somewere on cpanel for apache handlers. I must to do something their?
 Ii deleted the # from here "RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$"  but still no working
by
- it's ok to put it in the public_html folder , that is your q2a docroot

- if you checked the content of .htaccess and you say that it's identical to mine, but it's not working, then probably it is not "enabled" to work.
To enable it to work you must have the AllowOverride directive set to All (and not to None) in your Apache configuration file , that is inside apache2.conf or httpd.conf or userdir.conf (it depends from your setup/environment); the directive must be inside the Directory tag containing your docroot :

   <Directory /home/*/public_html>
                AllowOverride All
                .......
         
        </Directory>

It should be possible to modify these files manually or with cpanel (but I'm not a cpanel expert).
Usually the AllowOverride directive is enabled by default, sometimes it isn't.
If you do not know how to check it and/or modify the files, ask your hosting provider.

If your htaccess is enabled, the next thing to check is that your mod_rewrite has been enabled for your website. Usually it is, however it's better to check for it (ask your hosting provider ).
by
HI txx a lot for tring to help me.  I just instal a testing q&a on another subdomain on aanother domain and all url`s are with the okay sign. But here, when i try to instal on tuintrebi.ro still not working. I dont find on cpanel apache2.conf, httpd.conf or userdir.conf. I ask my host, but is not a very nice guy. It says to me to  instal again because the instalation are not the same on testing.filme-traduse.ro with tuintrebi.ro. But on tuintrebi.ro i have instaled over 10 time.. with new mysql base and no working, and on subdomain on filme-traduse.ro is working all the time. the same instalation step. Make a db with that 7 privileges, change qaconfig_example.php in qaconfig.php,  put there dbname db user and password and upload all files inclusive .htacces, make a superuser admin...Sorry for my bad english. How to check if apache config is set to allowoverrideall? The suport of my host answer slower than you :). Thx a lot for your help.
by
edited by
If you enable the first url structure and try to access to your website, which error do you receive ?
Do you see any message in your error_log ? ("Logs" section of CPanel)

However another quick (& dirty) check you could do (to check if the AllowOverride has been correctly set for your website) is reported here :

http://stackoverflow.com/a/7137139/1985230

Invoke your websiteurl/index.php using this site
http://web-sniffer.net
that allows you to see the response headers, and foow the instructions of the link that I've sent to you.
(The first test requires that you have the mod_headers enabled; if you do not have it installed you'll see an error on your error log file and you cannot do the first test; the second test is independent from the installed modules you have).
If the AllowOverrides works from the outcome of these tests, but on q2a the htaccess does not work, than probably your mod_rewrite has not been enabled (but you should see an error on your error log file; see at the beginning of my comment).

However you should wait for your hosting provider's answer to know exactly if the AllowOverride option is set  AND the mod_rewrite has been enabled on your website.
...