# Pretty URLs: /slug → view.php?p=slug
<IfModule mod_rewrite.c>
  RewriteEngine On

  # Skip real files/dirs
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^ - [L]

  # Admin routes (with .php) — skip
  RewriteRule ^(login|logout|dash|form|edit|submit|update|delete|imgdell|toggle|info|submit_form|install|view)\.php$ - [L]

  # Slug → view.php
  RewriteRule ^([a-z0-9-]+)/?$ view.php?p=$1 [L,QSA]
</IfModule>

# Default index
DirectoryIndex dash.php

# Protect config
<Files "config.php">
  Require all denied
</Files>

# Disable directory listing
Options -Indexes

# Upload safety
<IfModule mod_php.c>
  php_flag engine off
</IfModule>
<FilesMatch "\.(php|phtml|phar)$">
  Require all denied
</FilesMatch>
