توجه ! این یک نسخه آرشیو شده میباشد و در این حالت شما عکسی را مشاهده نمیکنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : مشکل htaccess در nginx و index
iraniam2000
December 22nd, 2016, 21:56
درود
دوستان یک سایتی دارم که وقتی htaccess اون را با سایت ها تبدیل و در Custom HTTPD Configurations وارد میکنم مشکل باز نشدن صفحات قبل از تبدیل از بین میره ولی نمیدانم چرا سایت باید حتما با index.php باز بشه وگرنه صفحه اول و ایندکس سایت صفحه سفید میاد و تنها مشکل باقی مانده همین هست وگرنه بقیه قسمت ها تماما مشکلشون حل میشه
از دوستان و اساتید اگر بتونند کمک کنند سپاسگزار میشم
فایل htaccess هم محتویاتش این هست
# override max php upload settings. Might not work on all servers
#php_value upload_max_filesize 4000M
#php_value post_max_size 4000M
# setup xsendfile if the module is enabled
<IfModule mod_xsendfile.c>
<Files *.php>
XSendFile On
SetEnv MOD_X_SENDFILE_ENABLED 1
</Files>
</IfModule>
# disable mod security
#<IfModule mod_security.c>
# SecFilterEngine Off
# SecFilterScanPOST Off
#</IfModule>
# route everything via index.php if it doesn't exist as a file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?_page_url=$1 [QSA]
iraniam2000
December 23rd, 2016, 20:58
سلام
یعنی هیچ کدام از دوستان اطلاعاتی در این مورد ندارند ؟
hegza
December 23rd, 2016, 23:42
# nginx configuration
index index.php;
کد بالا رو بهش اضافه کن
iraniam2000
December 24th, 2016, 02:52
# nginx configuration
index index.php;
کد بالا رو بهش اضافه کن
ممنون
فکر کردم کسی اینجا نمیخواد کمک کنه :53:
الان این کد را دقیقا به کجا اضافه کنم چون هر کاری کردم درست نشد که نشد
این هم تبدیل htaccess هست که قرار میدم و حتی تو بخش admin هم باید به صورت
admin/index.php
وارد بشم وگرنه صفحه سفید میاره !
# override max php upload settings. Might not work on all servers
#php_value upload_max_filesize 4000M
#php_value post_max_size 4000M
# setup xsendfile if the module is enabled
<IfModule mod_xsendfile.c>
<Files *.php>
XSendFile On
SetEnv MOD_X_SENDFILE_ENABLED 1
</Files>
</IfModule>
# disable mod security
#<IfModule mod_security.c>
# SecFilterEngine Off
# SecFilterScanPOST Off
#</IfModule>
# route everything via index.php if it doesn't exist as a file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?_page_url=$1 [QSA]
# nginx configuration
index index.php;
lastwall
December 24th, 2016, 11:19
سلام عرض ادب
اسکریپتتون اختصاصی هست!؟
این قسمت کد :
# route everything via index.php if it doesn't exist as a file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?_page_url=$1 [QSA]
یبار حذف کنید و بررسی کنید! :39:
باید تست و بررسی بکنید در صورت امکان میخواید دسترسی ارسال کنید بررسی کنیم اگر درست نشد
iraniam2000
December 24th, 2016, 15:26
سلام عرض ادب
اسکریپتتون اختصاصی هست!؟
این قسمت کد :
# route everything via index.php if it doesn't exist as a file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?_page_url=$1 [QSA]
یبار حذف کنید و بررسی کنید! :39:
باید تست و بررسی بکنید در صورت امکان میخواید دسترسی ارسال کنید بررسی کنیم اگر درست نشد
سلام
نه اسکریپت اختصاصی نیست
با این روش هم حل نشد ولی یک index.html با محتوای همان index.php هم درست کردم مشکل صفحه اصلی بدون index.php حل شد ولی الان آدرس سایت با index.html سفید میاد !
نمیدانم چرا هر بار یک جای کار میلنکه ؟
پ.ن.
دوستان این راهنما را پیدا کردم اگر کسی میتونه راهنمایی کنه خواهشا توضیح بده
If you're using NGINX as your webserver, use the rewrite rules below instead of .htaccess.
These will need adding to /etc/nginx/sites-available/default or wherever this file is located on your nginx install.
################################################## #####################
# START NGINX RULES
################################################## #####################
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
if (!-e $request_filename) { rewrite ^/(.*) /index.php?_page_url=$1 last; }
}
# these locations would be hidden by .htaccess normally
location /core/logs/ {
deny all;
}
################################################## #####################
# END NGINX RULES
################################################## #####################
################################################## #####################
# Full /etc/nginx/sites-available/default file example below:
################################################## #####################
server {
listen 80;
server_name localhost; # change this for your server
root /usr/share/nginx/html;
index index.php;
client_max_body_size 5G;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
if (!-e $request_filename) { rewrite ^/(.*) /index.php?_page_url=$1 last; }
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# these locations would be hidden by .htaccess normally
location /core/logs/ {
deny all;
}
################################################## #####################
# END NGINX RULES
################################################## #####################
################################################## #####################
# Full /etc/nginx/sites-available/default file example below:
################################################## #####################
server {
listen 80;
server_name localhost; # change this for your server
root /usr/share/nginx/html;
index index.php;
client_max_body_size 5G;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
if (!-e $request_filename) { rewrite ^/(.*) /index.php?_page_url=$1 last; }
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
تو ایران کسی نیست به این وب سرور آشنایی کامل داشته باشه ؟
ITarashe
December 25th, 2016, 11:55
سلام دوست عزیز.
کنترل مورد استفاده چی هست؟
iraniam2000
December 25th, 2016, 18:01
سلام دوست عزیز.
کنترل مورد استفاده چی هست؟
سلام
کنترل پنل که معلوم هست تو پست اول ولی دایرکت آدمین هستش
هر چند به شیوه ای مشکل را حل کردم و الان سایت با index.php و همچنین بدون اون باز میشه و مشکلی نیست فقط index.html سفید میاد که اون هم مهم نیست
ضمنا htaccess که تو پست چهارم قرار دادم مشکل دار هست و متاسفانه تو ریست nginx ریست نمیشد و خطا میداد و ناچارا کلا با روش دیگه کانفیگ را انجام دادم
ممنون از همه دوستان