Options -Indexes DirectoryIndex index.php RewriteEngine On # Dışarıdan açılmaması gerekenler RewriteRule ^(inc|\.git)(/|$) - [F,L] RewriteRule ^(config\.php|config\.local\.php|README\.md|LICENSE|\.gitignore|\.gitattributes|\.htaccess)$ - [F,L,NC] RewriteRule ^uploads/.*\.(php\d?|phtml|phar|pl|py|cgi|sh)$ - [F,L,NC] # Güzel adresler RewriteRule ^sitemap\.xml$ app.php?__page=sitemap.php [L,QSA] RewriteRule ^robots\.txt$ app.php?__page=robots.php [L,QSA] RewriteRule ^urun/([^/]+)/?$ app.php?__page=urun.php&slug=$1 [L,QSA] RewriteRule ^kategori/([^/]+)/?$ app.php?__page=kategori.php&slug=$1 [L,QSA] RewriteRule ^sayfa/([^/]+)/?$ app.php?__page=sayfa.php&slug=$1 [L,QSA] RewriteRule ^siparis/([0-9]+)/?$ app.php?__page=siparis.php&no=$1 [L,QSA] # Klasör ana sayfaları: / ve /admin/ RewriteRule ^$ app.php?__page=index.php [L,QSA] RewriteRule ^admin/?$ app.php?__page=admin/index.php [L,QSA] # .php ile istenen sayfalar RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^(?!app\.php$)(.+\.php)$ app.php?__page=$1 [L,QSA] # Uzantısız adres: /sepet -> sepet.php RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.+?)/?$ app.php?__page=$1.php [L,QSA]