ThaiSEOBoard.com

พัฒนาเว็บไซต์ => CMS & Free Script => ข้อความที่เริ่มโดย: DuliyaPlaceCondo ที่ 11 ตุลาคม 2017, 22:24:23



หัวข้อ: ใช้ Intro Page (Wordpress) คลิกลิงค์เข้าสู่หน้าเว็บหลักปกติไม่ได้
เริ่มหัวข้อโดย: DuliyaPlaceCondo ที่ 11 ตุลาคม 2017, 22:24:23
ใช้ Intro Page  [แจกฟรี] Intro Page ไว้อาลัยในหลวง CSS3 + Javascript (http://www.thaiseoboard.com/index.php/topic,400050.0.html)   บน (Wordpress) คลิกลิงค์เข้าสู่หน้าเว็บหลักปกติไม่ได้

ใช้ Wordpress คลิกลิงค์เข้าสู่หน้าเว็บหลักปกติไม่ได้ : www.domain.com (http://www.domain.com)

พอมีวิธีแก้ไขไหมครับ : www.domain.com/intro/index.html (http://www.domain.com/intro/index.html)   
:P


ขอบคุณครับ 


หัวข้อ: Re: ใช้ Intro Page (Wordpress) คลิกลิงค์เข้าสู่หน้าเว็บหลักปกติไม่ได้
เริ่มหัวข้อโดย: jakky ที่ 12 ตุลาคม 2017, 01:00:23
ลองวิธีนี้ดูครับ เผื่ออาจจะใช้ได้
ไปที่ตั้งค่า > ทั่วไป > ตรงที่อยู่เว็บไซต์ (URL) เติมคำว่า index.php เช่น http://เว็บ.คอม/index.php
ส่วนตรงที่อยู่เวิร์ดเพรส (URL) ไม่ต้องเติม
แป่ะโค้ดนี้ลงในส่วนล่างของไฟล์ index.php (อย่าลืมแก้ตรงคำว่าเว็บ.คอมทั้งสองบรรทัด)

โค๊ด:
$referrer = $_SERVER['HTTP_REFERER'];
if (preg_match("/เว็บ.คอม/",$referrer) ) {
    define('WP_USE_THEMES', true);
    require( dirname( __FILE__ ) . '/wp-blog-header.php' );
} else {
    header('Location: http://เว็บ.คอม/index.html');
};

แล้วก็อัพไฟล์สคริปขึ้นไปครับ


หัวข้อ: Re: ใช้ Intro Page (Wordpress) คลิกลิงค์เข้าสู่หน้าเว็บหลักปกติไม่ได้
เริ่มหัวข้อโดย: DuliyaPlaceCondo ที่ 13 ตุลาคม 2017, 00:24:04
ยังไม่ได้ ยังอยู่หน้า intro ตลอด
รบกวนช่วยดูโค้ดไฟล์ .htaccess ให้หน่อยครับ เหมือนซ้ำๆ  ไม่แน่ใจ แต่ไม่เข้าใจ ความคืออะไร?
 :P


ขอบคุณครับ



ไฟล์ .htaccess ครับ
อ้างถึง
DirectoryIndex intro2/index.html index.php
php_value output_buffering 1
# BEGIN Force http to https
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
# END Force http to https

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress


หัวข้อ: Re: ใช้ Intro Page (Wordpress) คลิกลิงค์เข้าสู่หน้าเว็บหลักปกติไม่ได้
เริ่มหัวข้อโดย: darkknightza ที่ 17 ตุลาคม 2017, 18:19:06
ลองวิธีนี้ดูครับ เผื่ออาจจะใช้ได้
ไปที่ตั้งค่า > ทั่วไป > ตรงที่อยู่เว็บไซต์ (URL) เติมคำว่า index.php เช่น http://เว็บ.คอม/index.php
ส่วนตรงที่อยู่เวิร์ดเพรส (URL) ไม่ต้องเติม
แป่ะโค้ดนี้ลงในส่วนล่างของไฟล์ index.php (อย่าลืมแก้ตรงคำว่าเว็บ.คอมทั้งสองบรรทัด)

โค๊ด:
$referrer = $_SERVER['HTTP_REFERER'];
if (preg_match("/เว็บ.คอม/",$referrer) ) {
    define('WP_USE_THEMES', true);
    require( dirname( __FILE__ ) . '/wp-blog-header.php' );
} else {
    header('Location: http://เว็บ.คอม/index.html');
};

แล้วก็อัพไฟล์สคริปขึ้นไปครับ

แวะมาดูความรู้ครับ