1

Hi im configuring a project in my localhost, but im getting this problem, when i try to enter this url localhost/project/public/ it redirects to HTTPS, and the other problem is that it repeats the url this way https://localhost/project/public/project/public.

This is my .htaccess file

Options -MultiViews

RewriteEngine On # Ignore the Moodle Folder for the Laravel's Route System RewriteCond $1 !^(cefovi) # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] 

Im not sure if this file is the problem or i have something else misconfigured. I have another project that supposedly has the same structure.

This project has inside the public folder an index file that calls the laravel project and a moodle folder called cefovi

Im not very sure whats the problem, hope you can help, thx

Im using Xampp and this is my httpd-vhosts file

# Virtual Hosts # # Required modules: mod_log_config # If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. Most configurations # use only name-based virtual hosts so the server doesn't need to worry about # IP addresses. This is indicated by the asterisks in the directives below. # # Please see the documentation at # <URL:http://httpd.apache.org/docs/2.4/vhosts/> # for further details before you try to setup virtual hosts. # # You may use the command line option '-S' to verify your virtual host # configuration. # # Use name-based virtual hosting. # ##NameVirtualHost *:80 # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ##ServerName or ##ServerAlias in any <VirtualHost> block. # ##<VirtualHost *:80> ##ServerAdmin [email protected] ##DocumentRoot "C:/xampp/htdocs/dummy-host.example.com" ##ServerName dummy-host.example.com ##ServerAlias www.dummy-host.example.com ##ErrorLog "logs/dummy-host.example.com-error.log" ##CustomLog "logs/dummy-host.example.com-access.log" common ##</VirtualHost> ##<VirtualHost *:80> ##ServerAdmin [email protected] ##DocumentRoot "C:/xampp/htdocs/dummy-host2.example.com" ##ServerName dummy-host2.example.com ##ErrorLog "logs/dummy-host2.example.com-error.log" ##CustomLog "logs/dummy-host2.example.com-access.log" common ##</VirtualHost> 
1
  • Can you also include your VirtualHost configuration? I think HTTPS redirect is happening there. Commented Jun 26, 2018 at 2:43

1 Answer 1

0

Regarding the redirect to HTTPS is probably because of your virtual host configuration. Please check find a statemnt

SSLEngine on

in your Virtualhost configuration and change it to

SSLEngine off

in addition, please check this similar question.

The URL repeat is likely because of the relative url used on href's If you are on laravel template, please use links like this.

<a href="{{url('/posts')}}">link</a> 

instead of using

<a href="/posts">link</a> 

In addition, what you write on the tag affects how your references/url's are addressed. i.e. if you have <base href="/project/public"> in your template, all the other relative references will have the "/project/public" prepend.

Hope that will help.

Sign up to request clarification or add additional context in comments.

1 Comment

Im not sure if thisis the file you´re asking

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.