• ป้ายโฆษณา
Banner

ยินดีต้อนรับ, ผู้เยี่ยมชม
กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน.    ลืมรหัสผ่าน?
Go to bottomหน้า: 1
หัวข้อ : ทำไม url ของเว็ปผม มันมี index.php ทุกหน้าเลยครับ
#17367
BoyThanakorn
พลังน้ำใจ: 0
มือใหม่จูมล่า
กระทู้: 16
ออฟไลน์ โปรไฟล์

ทำไม url ของเว็ปผม มันมี index.php ทุกหน้าเลยครับ
03.03.2010 13:48
ปริ๊นหน้านี้
เว็ปผมจะมี index.php ทุกหน้าเลยครับ บางทีพอเข้าหน้าที่ มีทั้ง .php กับ .html แล้วจะ error ครับ เป็นบางครั้ง

เช่น


www.tepball.com/index.php/The-News/Engla...ือปืน.html


จะแก้ไขยังงัยครับ
 
Last Edit: 03.03.2010 13:50 By BoyThanakorn.
The administrator has disabled public write access. ขึ้นบน
  • ป้ายโฆษณา
#17369
Slotpro
พลังน้ำใจ: 135
Mac OSX Start !
ผู้ดูแลระบบ
กระทู้: 4229
ออฟไลน์ โปรไฟล์

เพศ: ชายชาตรี
Re: ทำไม url ของเว็ปผม มันมี index.php ทุกหน้าเลยครับ
03.03.2010 14:24
ปริ๊นหน้านี้
เปิด mod_rewrite หรือยังถ้าไม่รู้ว่ามันคืออะไรลองพิมพ์บนช่องค้นหาครับ
 
The administrator has disabled public write access. ขึ้นบน
#17373
BoyThanakorn
พลังน้ำใจ: 0
มือใหม่จูมล่า
กระทู้: 16
ออฟไลน์ โปรไฟล์

Re:ทำไม url ของเว็ปผม มันมี index.php ทุกหน้าเลยครับ
03.03.2010 15:51
ปริ๊นหน้านี้
ผมลองเปิดใน localhost ดูแล้ว พอคลิ๊ก link มัน error
404 ผมลองอ่านใน link ด้านล้าง มันมีวิธีแก้ไข แต่ลิ้งเสียครับ

ช่วยด้วยครับ

www.noartclub.com/Forum/26-Sh404sef/13456-ปรับค่า-Rewriting-mode-เป็น-“with-htaccess-(mod_rewrite)”-แล้ว-error-404.html
 
The administrator has disabled public write access. ขึ้นบน
#17377
drlovecat
พลังน้ำใจ: 48
สายตรวจจูมล่า
กระทู้: 892
ออนไลน์ โปรไฟล์

thaifoodscience
Re:ทำไม url ของเว็ปผม มันมี index.php ทุกหน้าเลยครับ
03.03.2010 19:25
ปริ๊นหน้านี้
localhost ไม่ต้องไปเสียเวลาทำ sh404sef หรอกครับ ไปทำบนโฮสต์จริงเลยดีกว่า

แต่ถ้าจะลองเล่นบนเครื่องตัวเองก็เชิญครับ ว่าแต่คุณเปิด mod rewrite ในเครื่องคุณหรือยังละ..
 
The administrator has disabled public write access. ขึ้นบน
#17382
BoyThanakorn
พลังน้ำใจ: 0
มือใหม่จูมล่า
กระทู้: 16
ออฟไลน์ โปรไฟล์

Re:ทำไม url ของเว็ปผม มันมี index.php ทุกหน้าเลยครับ
04.03.2010 01:02
ปริ๊นหน้านี้
ทำได้ละ กว่าจะทำได้แทบตาย

ของผมต้อง เปลี่ยนชื่อไฟล์ htaccess.txt เป็น .htaccess
แล้วไปแก้ไข code ใน .htaccess
ในส่วนสุดท้าย ให้ เพิ่ม # ตรงหน้าทุกบรรทัด ให้เป็นดังนี้
########## Begin - Joomla! core SEF Section
############# Use this section if using ONLY Joomla! core SEF
## ALL (RewriteCond) lines in this section are only required if you actually
## have directories named 'content' or 'component' on your server
## If you do not have directories with these names, comment them out.
#
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
#RewriteCond %{REQUEST_URI} (/|.htm|.php|.html|/[^.]*)$ [NC]
#RewriteRule ^(content/|component/) index.php
#
########## End - Joomla! core SEF Section


แล้วก็ copy code นี้ต่อท้าย
########## Begin - 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
#
RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
RewriteCond %{REQUEST_URI} (/|.htm|.php|.html|/[^.]*)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php
#
########## End - 3rd Party SEF Section


แล้วไปเปิด mod_rewrite
ใช้ได้เลย
 
The administrator has disabled public write access. ขึ้นบน
#18606
chalermrit
พลังน้ำใจ: 0
มือใหม่จูมล่า
กระทู้: 25
ออฟไลน์ โปรไฟล์

Re:ทำไม url ของเว็ปผม มันมี index.php ทุกหน้าเลยครับ
10.05.2010 10:16
ปริ๊นหน้านี้
####
# @version $Id: htaccess.txt 10492 2008-07-02 06:38:28Z ircmaxell $
# @package Joomla
# @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
# @license www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


#####################################################
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################

## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
# mod_rewrite in use

RewriteEngine On

########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits

# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)

# RewriteBase /


########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|.php|.html|.htm|.feed|.pdf|.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section


ของผม ใช้ตามที่พี่บอก แต่มันก็ยังมี index.php อยู่อ่ะครับ แต่ว่าผมใช้ sh404sef ด้วยครับ

ผมอยากจะเอา index.php ออก ให้เป็น www.เว็บไซต์.com/เนื้อหา แล้วก็ใช้ sh404sef ไม่รู้ว่าจะต้องแก้ยังไง อ่ะครับ ใน ไฟล์ ผมก็ลองแก้ตามโค้ดข้างบนแล้ว มันก็ไม่เปลี่ยนอ่ะครับ พี่ๆๆ พอจะมีวิธีใหม่ครับ..
 
The administrator has disabled public write access. ขึ้นบน
#18610
drlovecat
พลังน้ำใจ: 48
สายตรวจจูมล่า
กระทู้: 892
ออนไลน์ โปรไฟล์

thaifoodscience
Re:ทำไม url ของเว็ปผม มันมี index.php ทุกหน้าเลยครับ
10.05.2010 12:57
ปริ๊นหน้านี้
^
^
คุณยังไม่ได้เพิ่ม Rewrite Rule

########## Begin - 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
#
RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
RewriteCond %{REQUEST_URI} (/|.htm|.php|.html|/[^.]*)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php
#
########## End - 3rd Party SEF Section
 
The administrator has disabled public write access. ขึ้นบน
Go to topหน้า: 1
ผู้ดูแลบอร์ด: Slotpro, milaza, pie, zen_ar218, Naris193, drlovecat
Back to Top