0
votes

I'm using Mac so I'm working with MAMP.

In /MAMP/conf/apache/httpd.config I did uncomment the second line:

#Virtual hosts  
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

Then in /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf I made this:

<VirtualHost *:80>
DocumentRoot "/Applications/MAMP/htdocs"
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "/User/xxxxx/Sites/mysite"
ServerName mysite
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "/Applications/MAMP/htdocs/laravel-blog/public"
ServerName laravel-blog.dev
</VirtualHost>

And my etc/hosts looks like this:

127.0.0.1       localhost            
255.255.255.255 broadcasthost
::1             localhost

127.0.0.1       mysite
127.0.0.1       laravel-blog.dev

so when I go to mysite:8888/ this redirects me to a page called 'Index of /' with all the folders that I have in htdocs

but when I go to laravel-blog.dev:8888/ it says the page failed to open

so I changed it: instead of laravel-blog.dev , I just used laravel-blog, changed it also in my /etc/hosts and in httpd-vhosts.conf file

and now when I go to laravel-blog:8888/ it redirects me back to this "Index of /" page, even tho the DocumentRoot is set to /Applications/MAMP/htdocs/laravel-blog/public

I have searched for hours and tried a lot of things but still nothing seems to redirect me to the '/public' page of an application, only redirects me back to the 'Index' which is the htdocs.

Anyone an explanation for this? how i can get to '/public'? And why laravel-blog.dev is not accepted but laravel-blog is? what has that .dev to do with anything?

1
I'm using Mac so I'm working with MAMP. use Valet. And forget about .dev use .test. - Kyslik

1 Answers

0
votes

All of this is a bit above me, but I find when I am redirecting using MAMP (not sure about MAMP PRO) I have to call the file index.(extension) or it will show the index of the whole folder. When you call the file index.(extension), it will open that file.

Hope this helps,

Nat