• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

[help] Rewrite url bằng .htaccess

GCN

New Member
Mình muốn rewrite url các files .html thành .php bằng htaccess, pro nào biết thì hướng dẫn mình nhé! Thanks!
 
hôm trước có xem qua mà quên nữa up top cho bạn nè...

----------> Bổ sung bài viết lúc 13:44 <----------> Bài viết trước lúc 13:15 <----------

c. Chuyển phần đuôi mở rộng từ .php sang .html

Việc chuyển .php sang .html có tác dụng khi bạn cần viết lại đường dẫn thân thiện với máy tìm kiếm .

RewriteRule ^(.*)\.html$ $1.php [R=301,L]

E Chuyển gạch dưới (_) thành gạch ngang(-) :

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

RewriteRule !\.(html|php)$ – [S=4]
RewriteRule ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ $1-$2-$3-$4-$5 [E=uscor:Yes]
RewriteRule ^([^_]*)_([^_]*)_([^_]*)_(.*)$ $1-$2-$3-$4 [E=uscor:Yes]
RewriteRule ^([^_]*)_([^_]*)_(.*)$ $1-$2-$3 [E=uscor:Yes]
RewriteRule ^([^_]*)_(.*)$ $1-$2 [E=uscor:Yes]

RewriteCond %{ENV:uscor} ^Yes$
RewriteRule (.*) http://www.adela.vn/$1 [R=301,L]

----------> Bổ sung bài viết lúc 13:45 <----------> Bài viết trước lúc 13:44 <----------

.php sang .html
thì ngược lại nha.
 
  • Like
Reactions: GCN

Facebook Comments

New posts New threads New resources

Back
Top