2

For anyone interested this was solved very simply by putting the root of my site to the public folder, Rookie error.

Hello ive just finished setting a website, and i am getting a weird redirect issue. When i first type in the URL https://project-wheels.co.uk when it gets to the site it redirects to https://project-wheels.co.uk/public. This still works fine as this is where the project index is.

My directory is as follows Application [folder] public [folder] .htaccess

Inside this first .ht access is

RewriteEngine on
RewriteRule ^(.*) public/$1 [L]

Then inside the public folder i have another htaccess

Options -MultiViews

RewriteEngine On

Options -Indexes

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

The index file in the public folder starts the mvc application etc.

I used the mini-master template and i have no experience at all with htaccess files other than these.

To give a little more information this website is actually hosted as a Addon domain and is routed to a folder in the public_html folder of the root, Im not sure if this makes any difference.

Thank you in advance Ryan

1 Answer 1

3

try this on your first .htaccess

RewriteEngine on 
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
Sign up to request clarification or add additional context in comments.

2 Comments

Still doesn't seem to work, Its really strange because sometimes it doesn't do it and other times it does. Am i missing a step to changing the htaccess, I dont need to do another step other than just doing FTP straight to server ? Ah i also forgot to put in the second htaccess (inside public) At the bottom i also have
RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.