# .htaccess to internally rewrite root to /hiyorimatcha/index.php and hide index.php in URLs
RewriteEngine On

# If request is exactly the domain root, internally serve /hiyorimatcha/index.php
RewriteRule ^$ /hiyorimatcha/index.php [L]

# If someone requests /hiyorimatcha/index.php, redirect to clean /hiyorimatcha/ (external redirect)
RewriteCond %{THE_REQUEST} /hiyorimatcha/index\.php [NC]
RewriteRule ^ /hiyorimatcha/ [L,R=301]

# Hide index.php in URLs under /hiyorimatcha/ (optional)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^hiyorimatcha/(.*)$ /hiyorimatcha/index.php [L]
