alismith
یک شنبه 01 آذر 1394, 15:52 عصر
سلام
دوستان من یک اسکریپت php دارم که روی debian داره اجرا میشه اما فایل htaccess خوب کار نمیکنه یعنی بخش مربوط به rewriteCond فقط کار نمیکنه
این سوال کامل تو استک http://stackoverflow.com/questions/33854781/rewritecond-not-working-in-debian
اینم کد :
IndexIgnore *Options -Indexes
RewriteEngine on
RewriteRule ^(config/|config\.php) - [F,L,NC]
RewriteRule ^article/(.*)/? index.php?article&do=view&title=$1 [L,QSA]
RewriteRule ^thesis/(.*)/? index.php?thesis&do=view&title=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} $
RewriteCond $1 !^(index)
RewriteRule ^(.*)/? index.php?$1&route=true [L,QSA]
RewriteRule ^me/? index.php?me [L,QSA]
RewriteRule ^home/? index.php?home [L,QSA]
RewriteRule ^layout1.php index.php?layout1 [L,QSA]
الان مثلا آدرس :
domain/home
کار میکنه اما :
domain/foo
کار نمیکنه
لطفا راهنمایی کنید دوستان
با تشکر
دوستان من یک اسکریپت php دارم که روی debian داره اجرا میشه اما فایل htaccess خوب کار نمیکنه یعنی بخش مربوط به rewriteCond فقط کار نمیکنه
این سوال کامل تو استک http://stackoverflow.com/questions/33854781/rewritecond-not-working-in-debian
اینم کد :
IndexIgnore *Options -Indexes
RewriteEngine on
RewriteRule ^(config/|config\.php) - [F,L,NC]
RewriteRule ^article/(.*)/? index.php?article&do=view&title=$1 [L,QSA]
RewriteRule ^thesis/(.*)/? index.php?thesis&do=view&title=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} $
RewriteCond $1 !^(index)
RewriteRule ^(.*)/? index.php?$1&route=true [L,QSA]
RewriteRule ^me/? index.php?me [L,QSA]
RewriteRule ^home/? index.php?home [L,QSA]
RewriteRule ^layout1.php index.php?layout1 [L,QSA]
الان مثلا آدرس :
domain/home
کار میکنه اما :
domain/foo
کار نمیکنه
لطفا راهنمایی کنید دوستان
با تشکر