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

Why does the OK mark not appear in front of the structure you chose from the .htaccess file, which is detailed as follows:

******************************

# Redirect to www and HTTPS

RewriteEngine On

RewriteCond %{HTTPS} off [OR]

RewriteCond %{HTTP_HOST} !^www\. [NC]

RewriteRule ^ https://www.examplesite.com%{REQUEST_URI} [L,NE,R=301]

# In order for the web server to process this file it must be renamed to ".htaccess"

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>

**************************

Can anyone help me solve this problem, and is there a problem with htaccess, knowing that I am not a programmer?

Q2A version: v1.8.8
by
There's a space missing before the dot in the second RewriteRule statement, and all rewrite conditions and rules should be inside the IfModule block.
What web server are you using? The .htaccess file that ships with Q2A is for the Apache webserver. Other web servers may need different configs. And does your web server config allow overrides in the first place ("AllowOverride All" for Apache web servers).
Related: https://docs.question2answer.org/install/htaccess/
by
Thank you, dear, for your response, but I tried to check the second line as you said, but I did not discover what you meant?
Your generosity, can you help me write the file correctly, knowing that I am not a programmer?
by
For your information, I use Apache web server
by
You don't need to be a programmer to run a web server, but you do need to be familiar with the operation and more specifically the configuration of your web server.

With that said, the line "RewriteRule. %1/%2 [R=301,L]" should be "RewriteRule . %1/%2 [R=301,L]" (note the additional space). Did you make sure that your Apache configuration allows overrides? Also, check your web server logs for errors/warnings.

Please log in or register to answer this question.

...