Problem with . htaccess

Asked

Viewed 459 times

1

Good morning, I picked up a website to do some work on it.

I use easyphp and can’t open any site page on localhost (only from this site)

I believe it may be the . htaccess file that redirects the links typed. For example. When I type localhost:8080/fenpor/aprendoemcasa.com.br/index.php to open the page it redirects to https://www.localhost:8080/index.php

Here is the part of the file . htaccess that does this

RewriteBase /
RewriteEngine on

RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]   
#
RewriteCond %{HTTP_HOST} ^(?!www\.)(.+) [NC]
RewriteRule ^(.*) https://www.%1/$1 [R=301,NE,L]

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

I tried to disable this link exchange function by switching off Rewriteengine.

RewriteEngine off

But in doing so the following error happens:

Erro

I found where the DOCROOT is being defined and the line is like this.

define ('__DOCROOT__', '/home/fenpor/aprendoemcasa.com.br');

But this is the way that came from the backup, and honestly I have no idea how to mess with . htaccess or even this DOCROOT. Can someone please help? I’ve been trying for days to see at least one page of the site and I can’t. I also can’t find a solution on the internet. What is the correct path that I should put there in the DOCROOT definition? If I put the correct path my problem will be solved? Thank you very much in advance

1 answer

0


Problem solved simply in the end.

I changed the file . htaccess

RewriteEngine off

I went to the apache file folder, which is found in the easyphp files, and opened the file httpd.conf. I was inside searching for the word Documentroot

and I can find the exact path to the Documentroot file.

In the Connection file, I put the correct Documentroot path that was found on the httpd.conf.

define ('__DOCROOT__', 'CAMINHO-CORRETO');

solved!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.