D
D
Denis Bukreev2016-03-01 21:05:48
MAMP
Denis Bukreev, 2016-03-01 21:05:48

How to redirect from root to /public on MAMP?

I have MAMP as a local server
. How can I make it so that when I visit the local version of the site, the index in the public folder immediately opens?
On hosting, it is clear - I uploaded all the files and renamed the public folder, in my case, to public_html
And what to do with the local server? After all, these are completely different paths, and it’s inconvenient in itself when you need to enter extra paths in the address bar

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2016-03-01
@denisbookreev

1 way:
change in the root directory server.php to index.php
2 way:
create .htaccess in the root directory and paste -

<IfModule mod_rewrite.c>
    RewriteEngine On
 
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question