Mod rewrite URL for johncms

1.74K
.
manhhung
Lấy ví dụ cái http://johncms.daivietpda.com/forum làm thực hành nhé
Đây là johncms 4.0.1 Đầu tiên chưa chỉnh sửa ta có url của chuyên mục trong forum như sau
[code]http://johncms.daivietpda.com/forum/index.php?id=1[/code]
Chuyên mục có tên là : Phần mềm ứng dụng
Bây giờ chúng ta sẽ chỉnh sửa để rewrite url thành
[code]http://johncms.daivietpda.com/forum/Phan-mem-ung-dung_1.html[/code]
Việc làm này tức là tạo ra đường dẫn ảo , nhằm mục đích thận thiện với các search engine , nói chung là để seo cho wap được mọi người biết đến nhiều hơn
Để có được đường dẫn đẹp như trên các bạn cần làm các bước như sau
Tôi sẽ hướng dẫn các bước làm trước và phân tích các bước sau nhé
Bước 1 :
Mở file .htaccess của johncms tìm đến dòng
[code]RewriteRule .* - [F][/code]
Thêm vào bên dưới
[code]RewriteRule _(.*)\.html$ /forum/index.php?id=$1[/code]
Bước 2:
Download file url.php đính kèm bên dưới , giải nén vào thư mục /incfiles
Bước 3:
Mở file forum/index.php
Tìm line 16
[code]require('../incfiles/core.php');[/code]
Thêm vào bên dưới
[code]require('../incfiles/url.php');[/code]
Tìm : line 749
[code] echo '<a href="index.php?id=' . $res['id'] . '">' . $res['text'] . '</a> [' . $count . ']';[/code]
Thay thế bằng :
[code] echo '<a href="' . ___($res['text']) . '_' . $res['id'] . '.html">' . $res['text'] . '</a> [' . $count . ']';[/code]
Tìm : line 302
[code] echo '<a href="?id=' . $res['id'] . '">' . $res['text'] . '</a>';[/code]
Thay thế bằng :
[code] echo '<a href="' . ___($res['text']) . '_' . $res['id'] . '.html">' . $res['text'] . '</a>';[/code]
Tìm : line 349
[code] echo '<a href="index.php?id=' . $res['id'] . '">' . $res['text'] . '</a> [' . $colmes1 . ']';[/code]
Thay thế bằng :
[code] echo '<a href="' . ___($res['text']) . '_' . $res['id'] . '.html">' . $res['text'] . '</a> [' . $colmes1 . ']';[/code]
Tìm : line 232
[code] $tree[] = '<a href="index.php?id=' . $parent . '">' . $res['text'] . '</a>';[/code]
Thay thế bằng :
[code] $tree[] = '<a href="' . ___($res['text']) . '_' . $parent . '.html">' . $res['text'] . '</a>';[/code]
Lưu lại tất cả và thưởng thức
Các bạn có thể thay đuôi .html bằng bất kể đuôi gì mà bạn muốn , ví dụ như msv dùng .msv đó
Nếu các bạn lech đi đâu vui lòng để lại nguồn http://daivietpda.com cám ơn nhiều
http://daivietpda.com
url.zip
Mod rewrite url for johncms.zip
.
Source http://daivietpda.com/mobile-w ... .html
.
did u know how to speaking english!?
.
¤
Please speak english
.
For example the practice http://johncms.daivietpda.com/forum do nhé
This is the first 4.0.1 johncms not have to edit the url in the forum the following categories
[Code] http://johncms.daivietpda.com/ ... ?id=1 [/ code]
Topics called: Application Software
Now we'll edit the url to rewrite
[Code] http://johncms.daivietpda.com/ ... .html [/ code]
Doing this means creating a virtual path, for the purpose of search engine friendly, seo generally to everyone for wap is known more
To get on the path as beautiful as you do the following steps
I will guide the steps before and after the offline analysis steps
Step 1:
Open. Htaccess file to find lines of johncms
[code]RewriteRule .* - [F][/code]
Add below
[code]RewriteRule _(.*)\.html$ /forum/index.php?id=$1[/code]
Step 2:
Download file attachments url.php below, unzip the folder / incfiles
Step 3:
File open forum / index.php
Find line 16
[code]require('../incfiles/core.php');[/code]
Add below
[code]require('../incfiles/url.php');[/code]
Find: line 749
[code] echo '' . $res['text'] . ' [' . $count . ']';[/code]
Replace with:
[code] echo '' . $res['text'] . ' [' . $count . ']';[/code]
Find: line 302
[code] echo '' . $res['text'] . '';[/code]
Replace with:
[code] echo '' . $res['text'] . '';[/code]
Find: line 349
[code] echo '' . $res['text'] . ' [' . $colmes1 . ']';[/code]
Replace with:
[code] echo '' . $res['text'] . ' [' . $colmes1 . ']';[/code]
Find: line 232
[code] $tree[] = '' . $res['text'] . '';[/code]
Replace with:
[code] $tree[] = '' . $res['text'] . '';[/code]
Save and enjoy all
You can replace the tail. Html by tail regardless of what you want, for example, msv used. Msv that
Lech If you go please leave a thank you more sources http://daivietpda.com
http://daivietpda.com
url.zip
.
do you can't use google translit? Fuck you mean? )) haha you should think about yourself before ask manhhung. Mad vãi lồn! Anh em việt nam thông cảm, éo biết viết tiếng anh chữ vãi lồn ))
.
Tungmaster (25.02.2011/17:14)
do you can't use google translit? Fuck you mean? )) haha you should think about yourself before ask manhhung. Mad vãi lồn! Anh em việt nam thông cảm, éo biết viết tiếng anh chữ vãi lồn ))
Do you know How to read topic Category? can you read this words? "English Forum"
That's why they are asking if he can speak English or not!!!
.
can you speak english please
.
ardzcyber
Before this topic is made, I had the practice of making a SEO friendly jcms, but only on the menu only forum
demo: http://ardzcyber.com
.
Who can share john cms 4.2 full mod
Всего: 18