# ==============================================================================
#   REFLECT
#   -------
#   Prevent public access to the domain of your WordPress CMS, except
#   for requests coming from your Reflect site and from IP addresses you approve.
#
#   GPLv2 or later license.
#   More details can be found at https://github.com/davidgoy/reflect
#
#   Don't forget to replace the dummy IP addresses (000.000.000.000) with real
#   IP addresses!
# ==============================================================================

#<IfModule mod_rewrite.c>

#  RewriteEngine On

#  Options +FollowSymlinks

#  RewriteBase /

#  # Grant access if the request comes from the primary IP address of the server hosting your Reflect instance
#  # (to determine this IP address, simply ping your server's hostname)
#  RewriteCond %{REMOTE_ADDR} !^000.000.000.000

#  # Grant access if the request comes from the IP address of the user who will be managing your WordPress site (e.g. you)
#  RewriteCond %{REMOTE_ADDR} !^000.000.000.000

#  # Optional: Grant access if the request comes from the IP address of the following approved user(s)
#  # (duplicate the below line for each user that you want to allow access to your WordPress site)
#  RewriteCond %{REMOTE_ADDR} !^000.000.000.000

#  # Grant access if the request is for your WordPress site's API
#  RewriteCond %{REQUEST_URI} !^(.*)?wp-json/wp/v2/

#  # Grant access if the request is for images, icons or videos
#  # (add more media formats as you wish)
#  RewriteCond %{REQUEST_URI} !\.(?:jpg|jpeg|png|gif|ico|webm|ogg|ogv|avi|mov|wmv|mp4|m4v|mpg|mpeg)$ [NC]

#  # Show 403 error for all other requests
#  RewriteRule .* - [F,L]

#</IfModule>


# ==============================================================================
#   WORDPRESS
#   ---------
#   Taken from https://wordpress.org/support/article/using-permalinks/
# ==============================================================================

# BEGIN WordPress

<IfModule mod_rewrite.c>

  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]

</IfModule>

# END WordPress