Skip to content

Instantly share code, notes, and snippets.

@muhittin
Created January 16, 2013 23:03
Show Gist options
  • Save muhittin/4551823 to your computer and use it in GitHub Desktop.
Save muhittin/4551823 to your computer and use it in GitHub Desktop.
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
# Eğer sitenize doğrudan www.siteniz.com domaini ile girilirse:
RewriteCond %{HTTP_HOST} www.siteniz.com$ [NC]
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]
# Eğer sitenizdeki dinamik subdomaine ait bir alt sayfaya girilirse:
RewriteCond %{HTTP_HOST} ^([a-z0-9-]+)\.siteniz\.com$ [NC]
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)$ index.php/user/%1/$1 [L]
# Eğer sitenizdeki dinamik subdomain sayfasına girilirse:
RewriteCond %{HTTP_HOST} ^([a-z0-9-]+)\.siteniz\.com$ [NC]
RewriteCond %1 !^(www)$ [NC]
RewriteRule ^$ index.php/user/%1 [L]
# Eğer sitenize başında "www" olmadan girilirse:
RewriteCond %{HTTP_HOST} siteniz\.com$ [NC]
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment