<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: crankysparrow</title>
    <description>The latest articles on DEV Community by crankysparrow (@crankysparrow).</description>
    <link>https://dev.to/crankysparrow</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F150871%2Fc8de59a1-5b4f-42be-be7d-ad471928dafc.jpg</url>
      <title>DEV Community: crankysparrow</title>
      <link>https://dev.to/crankysparrow</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/crankysparrow"/>
    <language>en</language>
    <item>
      <title>Choppy Slider: The Styles</title>
      <dc:creator>crankysparrow</dc:creator>
      <pubDate>Tue, 16 Jun 2020 22:45:41 +0000</pubDate>
      <link>https://dev.to/crankysparrow/choppy-slider-the-styles-43p4</link>
      <guid>https://dev.to/crankysparrow/choppy-slider-the-styles-43p4</guid>
      <description>&lt;p&gt;I made this photo slider for a CodePen challenge; the prompt was to &lt;a href="https://codepen.io/challenges/2020/june/1"&gt;create something using a sequenced animation&lt;/a&gt;. I'm not trying to make a tutorial for the whole thing, but I'd like to record a few interesting bits here. You can check out the finished product &lt;a href="https://codepen.io/crankysparrow/pen/wvMaady"&gt;CodePen&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;This post is going to cover some of the CSS styles used in the slider; I'll make another soon with more details about the animation itself! &lt;/p&gt;

&lt;h2&gt;
  
  
  Cutting up an Image with background-position
&lt;/h2&gt;

&lt;p&gt;I wanted to chop up each image into smaller pieces so I could create an effect of each piece sliding across the screen. Instead of using multiple &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; tags, I created several &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;s with the same background image. Then I used the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/background-position"&gt;background-position&lt;/a&gt; property to position the image exactly how I wanted it. &lt;/p&gt;

&lt;p&gt;I generally passed 2 values to the background-position property. The first defines the position of the image on the x-axis, and the second defines the position on the y-axis. So, for example, &lt;code&gt;background-position: -100px 100px&lt;/code&gt; will move the background image 100px to the left and 100px down. Here's a quick demo of some &lt;code&gt;background-position&lt;/code&gt; properties: &lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/crankysparrow/embed/RwrGXYj?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;I used this behavior to generate a few differently-positioned blocks with the background photo aligned in different ways. I wanted them to be close to lining up but not exactly, so I tweaked the numbers a bit and in some cases made blocks wider than their container. Often these tweaks meant adjusting the &lt;code&gt;background-size&lt;/code&gt; property as well. &lt;/p&gt;

&lt;p&gt;So after some fiddling I came up with something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.section&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nl"&gt;background-repeat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;no-repeat&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.one&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;110%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;100%&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;background-position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-100px&lt;/span&gt; &lt;span class="m"&gt;-100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; 
&lt;span class="nc"&gt;.two&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;120%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;-120px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;99&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.three&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;115%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;60px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;-200px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;60px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-50px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.four&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;105%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;65px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;105%&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;165px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;40px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;99&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's what these pieces look like so far: &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VLO7UYJ9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fxkzn5pobpafheb20y50.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VLO7UYJ9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fxkzn5pobpafheb20y50.png" alt="Chopped up photo" width="599" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here's what it looks like once we add the full image into the slide: &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JDnd_80N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/s1tdecmdkmrx8a5imdgf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JDnd_80N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/s1tdecmdkmrx8a5imdgf.png" alt="Chopped up photo" width="603" height="431"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  CSS Blend Modes and Filters
&lt;/h2&gt;

&lt;p&gt;The above layout looks pretty neat, but I wanted to bring in a little more variation. So I used &lt;code&gt;mix-blend-mode: overlay&lt;/code&gt; on the sections positioned over the main image. Check the MDN Docs for info on &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode"&gt;several other blend modes&lt;/a&gt; available in CSS.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode"&gt;filter&lt;/a&gt; property was new to me and fun to play with! I used this to adjust contrast, saturation, brightness, and hue (just a little bit) of a few of the sections.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.one&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nl"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;brightness&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1.6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;hue-rotate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;10deg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;contrast&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1.2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.two&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="py"&gt;mix-blend-mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;overlay&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.three&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nl"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;brightness&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1.3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;saturate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;.9&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;hue-rotate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;10deg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.four&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="py"&gt;mix-blend-mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;overlay&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="nl"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;brightness&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1.3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;hue-rotate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;20deg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I added a black background to the page, so the image looked like this: &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3gwK0akE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/neai1ufmcubrd8fngdlv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3gwK0akE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/neai1ufmcubrd8fngdlv.png" alt="Cut up photo with CSS blend and filterr" width="617" height="422"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Next up: The actual animation!
&lt;/h2&gt;

&lt;p&gt;I'm going to write another post soon about how the slider actually &lt;em&gt;moves&lt;/em&gt;. For now you can check out the finished product on &lt;a href="https://codepen.io/crankysparrow/pen/wvMaady"&gt;CodePen&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/crankysparrow/embed/wvMaady?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>slider</category>
      <category>codepen</category>
    </item>
    <item>
      <title>Configuring Virtual Hosts With MAMP</title>
      <dc:creator>crankysparrow</dc:creator>
      <pubDate>Thu, 28 May 2020 17:05:06 +0000</pubDate>
      <link>https://dev.to/crankysparrow/configuring-virtual-hosts-with-mamp-f3i</link>
      <guid>https://dev.to/crankysparrow/configuring-virtual-hosts-with-mamp-f3i</guid>
      <description>&lt;p&gt;When I'm developing for WordPress, I use &lt;a href="https://www.mamp.info/en/mamp/mac/"&gt;MAMP&lt;/a&gt; to serve my sites locally. By default, MAMP serves to port 8888. I keep all my WordPress work in one folder served up by MAMP, so each site in that folder is served at &lt;code&gt;localhost:8888/mysite&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;At some point I started running into problems with this URL structure, mainly because &lt;a href="https://stackoverflow.com/questions/5559578/having-links-relative-to-root"&gt;root-relative URLs&lt;/a&gt; would link to the wrong places. For example, on a site at &lt;code&gt;localhost:8888/mysite&lt;/code&gt;, &lt;code&gt;&amp;lt;img src="/image.jpg"/&amp;gt;&lt;/code&gt; would link to &lt;code&gt;localhost:8888/image.jpg&lt;/code&gt; instead of &lt;code&gt;localhost:8888/mysite/image.jpg&lt;/code&gt; like I needed it to. &lt;/p&gt;

&lt;p&gt;I needed a way to serve my sites locally with a base URL these relative links to resolve to. Enter virtual hosts! These allow us to serve content to multiple domain names at once. &lt;/p&gt;




&lt;p&gt;Here's how I set up MAMP with virtual hosts on my Mac: &lt;/p&gt;

&lt;h2&gt;
  
  
  1. Edit hosts file
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;/etc/hosts&lt;/code&gt; file on your local machine maps custom domain names to the IP addresses. It's protected, so you'll likely have to use &lt;code&gt;sudo&lt;/code&gt; to open it and enter your Mac password. &lt;/p&gt;

&lt;p&gt;To edit your hosts file in vim, open your preferred terminal and enter &lt;code&gt;sudo vim /etc/hosts&lt;/code&gt;. You'll see something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;&lt;span class="c"&gt;##&lt;/span&gt;
&lt;span class="c"&gt;# Host Database&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;
&lt;span class="c"&gt;# localhost is used to configure the loopback interface&lt;/span&gt;
&lt;span class="c"&gt;# when the system is booting.  Do not change this entry.&lt;/span&gt;
&lt;span class="c"&gt;##&lt;/span&gt;
127.0.0.1       localhost 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't delete anything, just add another line beneath the localhost line with your desired host name like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;127.0.0.1       localhost
127.0.0.1       yoursite.loc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then save the file and exit. &lt;/p&gt;

&lt;p&gt;I like to end mine with .loc but you can use .dev or something else as well. It should be unique but easy for you to remember. &lt;/p&gt;

&lt;h2&gt;
  
  
  2. Edit MAMP Apache config file
&lt;/h2&gt;

&lt;p&gt;Now go to the directory your MAMP install is located in. Mine is at &lt;code&gt;/Applications/MAMP&lt;/code&gt; which is the default, so that's what I'll use as the path for the following examples. &lt;/p&gt;

&lt;p&gt;Find the Apache config file at &lt;code&gt;/Applications/MAMP/conf/apache/httpd.conf&lt;/code&gt; and open it in an editor. There's likely a bunch of stuff in here; scroll through and find these lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;&lt;span class="c"&gt;# Virtual hosts&lt;/span&gt;
&lt;span class="c"&gt;# Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All you need to do here is un-comment that second line, so it looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;&lt;span class="c"&gt;# Virtual hosts&lt;/span&gt;
&lt;span class="nc"&gt;Include&lt;/span&gt; /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Edit your virtual hosts file
&lt;/h2&gt;

&lt;p&gt;Next, open the virtual hosts file at &lt;code&gt;/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;There will probably be some comments and a couple of examples of  blocks there. Leave the comments or delete as you'd like, then replace the examples with the information below. The second block includes the path to the site you're developing and the local domain name you added in the first step. So your file should look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;&lt;span class="nc"&gt;NameVirtualHost&lt;/span&gt; *:80

&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nl"&gt;VirtualHost&lt;/span&gt;&lt;span class="sr"&gt; *:80&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="nc"&gt;DocumentRoot&lt;/span&gt; "/Applications/MAMP/htdocs"
    &lt;span class="nc"&gt;ServerName&lt;/span&gt; localhost
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nl"&gt;VirtualHost&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nl"&gt;VirtualHost&lt;/span&gt;&lt;span class="sr"&gt; *:80&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="nc"&gt;DocumentRoot&lt;/span&gt; "/Users/youruser/your/site/root"
    &lt;span class="nc"&gt;ServerName&lt;/span&gt; yoursite.loc
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nl"&gt;VirtualHost&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. You're Done!
&lt;/h2&gt;

&lt;p&gt;Restart MAMP if it was running already and head to the domain you added. Your site should be live there! &lt;/p&gt;




&lt;h2&gt;
  
  
  Just in case...
&lt;/h2&gt;

&lt;p&gt;If you run into errors, you may also need to go back to the &lt;code&gt;httpd.conf&lt;/code&gt; file we edited above and allow SymLink override. Open that file, find the block below, and make sure &lt;code&gt;AllowOverride&lt;/code&gt; is set to &lt;code&gt;All&lt;/code&gt; rather than &lt;code&gt;None&lt;/code&gt;. So it should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nl"&gt;Directory&lt;/span&gt;&lt;span class="sr"&gt; /&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="nc"&gt;Options&lt;/span&gt; &lt;span class="ss"&gt;Indexes&lt;/span&gt; &lt;span class="ss"&gt;FollowSymLinks&lt;/span&gt;
    &lt;span class="nc"&gt;AllowOverride&lt;/span&gt; &lt;span class="ss"&gt;All&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nl"&gt;Directory&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;I hope this is helpful for anyone needing a reference for setting this up! Feel free to comment and let me know if you have any questions or suggestions. &lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>mamp</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
