Otaku, Figure, Anime, Games, Jpop, Tech, Nihongo, Cosplay, DSLR, Photography, Camera
  CATEGORIES: HOME | FIGURE | ANIME | GAME | JPOP | JAPAN | TECH | SITE | ARCHIVE                    RSS Feeds
| Most Recent Post:
Suzumiya Haruhi Blu-ray!
Suzumiya Haruhi Blu-ray! A rather belated news; "The Melancholy of Haruhi Suzumiya Complete Blu-ray Box...
Figma Suzumiya Haruhi Middle School Reserved!
Figma Suzumiya Haruhi Middle School Reserved! Now this is something that I have been keeping both of my...
Collet Little Devil Santa
Collet Little Devil Santa Belated news, "high-end" moe figure Collet is up for pre-order again and...
Site moved back to paid hosting
Site moved back to paid hosting So I have moved this blog from free host Byethost to my...
Nendoroid Saber
Nendoroid Saber Saber fans, the wait is over! Nendoroid Saber "Super Moveable Edition" is...
Convert PSP video at 60fps using TMPGEnc
Convert PSP video at 60fps using TMPGEnc The PSP is an excellent portable video player but it's a pity...


| Most Recent Comments:
Divine Fang @ Suzumiya Haruhi Blu-ray!
@ Fabrice, I have a few figurines coming in so I haven't placed...
Fabrice @ Suzumiya Haruhi Blu-ray!
Im seriously thinking about pre ordering this, amazone price is quite good, Mhmm needs...
Divine Fang @ Figma Suzumiya Haruhi Middle School Reserved!
@ Fabrice, *Yosha!* I am pretty sure it will be included in...
Fabrice @ Figma Suzumiya Haruhi Middle School Reserved!
Yay i ordered her! :3 but dam this cam unexpected! ...
Divine Fang @ Site moved back to paid hosting
@ Fabrice, Thanks! It just couldn't be better now ^^!...

avatar Rewrite Search Engine Friendly URL
Posted: August 22nd, 2008 2:21 pm (Fri) by Divine Fang
Last Edited: August 22nd, 2008 2:45 pm (Fri) Views: 3214 [Permalink]
Tag: Site, Linux, Apache, Programming, SEF, URL
Rewriting Search Engine Friendly URL (SEF URL) had been a mystery but a simple search string of "Rewrite URL" returns a tool that got the mystery solved almost immediately! As programming is nothing more than just a hobby of mine, I didn't venture into the technical details of rewriting a SEF URL. The solution I found was located at Webconfs. Input a dynamic URL there and the "Tool" will produce a static URL and codes required to be written/added on a htaccess file. The code was then customised to suit my needs since it's pretty much self-explanatory.

Kotomi-chan
Above: Kotomi Ichinose of Clannad


For this site, a single .htm URL pattern is used to cloak the dynamic URL. If you are a frequent reader you should have probably noticed non-SEF URL used previously, such as

http://www.shin-otaku.com/index.php?permalink=20080815091246&title=moetan_pastel_ink_nendoroid_unboxing
http://www.shin-otaku.com/index.php?category=archive



With simple codes applied to htaccess file as below,

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*)-(.*).htm$ index.php?permalink=$1&title=$2

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*).htm$ index.php?category=$1

non-SEF URLs become

http://www.shin-otaku.com/20080815091246-moetan-pastel-ink-nendoroid-unboxing.htm
http://www.shin-otaku.com/archive.htm


Extras
SEF may not be a concern for Blogspot or Wordpress users since both are readily SEF but for those otakus who are interested, proceed reading about:

Mod_rewrite & URL rewriting guide
SEF advantages

Read or post comment (10 Otaku comments)
nanu
(USA)
Posted August 22nd, 2008 3:39 pm (Fri)  
nothing more than a hobby eh? i'd say you're doing pretty well learning this on your own and applying it ;)

nanu
(USA)
Posted August 22nd, 2008 7:59 pm (Fri)  
OT: I just realized who's in your header after revisiting recent and not-so-recent figure pictures and barely noticing heterochromia in them ;o;

Divine Fang
(Kuala Lumpur, KL)
Posted August 23rd, 2008 9:22 am (Sat)  
@ nanu,
Yup, feels good to have this blog programmed manually. Arigatou gozaimasu!
OT: The current header is "possibly the cutest vampire ever" Chua Churam as stated here :)

gordon
(Singapore 新加坡)
Posted August 23rd, 2008 11:22 am (Sat)  
yes using SEF URL is very important.

putting words in your title that people will commonly do a search on google will bring about traffic. i find that in some cases, people who blogs about figures get lots of hits but few comments cos people come in via google search.

and putting sexual terms works likewise too but hey we aren't going to go that way right? ^^;

The UltraBeast
(Proud Son of Cheras)
Posted August 24th, 2008 7:51 am (Sun)  
GOOD ~!! It seems that you solved this riddle. :D

So it looks like the pattern is that it will chuck away everything in the second string i.e.
index.php?permalink=$1&title=$2

and tack on a .htm to whatever is remaining.

Divine Fang
(Kuala Lumpur, KL)
Posted August 24th, 2008 9:37 am (Sun)  
@ Gordon,
True, it seems like most visitors are referred by google especially image.google.com and they suck up serious bandwidth.
I bet you have gotten quite a good amount of traffic here and here ohoho...

@ The Ultrabeast,
You're right. But I've discovered that the rules I that modified above are bad. They "overlap" a real static URL ending with .htm!!! Problems will arise when I have a real static URL later... :O

Saku
(Toronto, Canada)
Posted August 26th, 2008 8:39 pm (Tue)  
Very good info. I am using wordpress already so SEF URL is not an issue but this would come in handy in the future.

Divine Fang
(Kuala Lumpur, MY)
Posted August 27th, 2008 12:49 pm (Wed)  
@ Saku,
Welcome! I have to say that Wordpress is by far a much more blogger-friendly, search-engine-friendly, and most importantly visitor-friendly blog CMS (Content Management System) and I may switch to it one day LOL!!!

The UltraBeast
(Proud Son of Cheras)
Posted September 17th, 2008 3:26 am (Wed)  
@Divine:

Ehhhh? How come you're looking to possibly switch to WP in future? I thought you've already got a good thing going on here?

About the static URL overlap, it's not a big problem at all, really.. I think all CMS SEF also 'masks' out actual .htm files which happen to have the exact same name. Which doesn't happen very often at all.

Divine Fang
(Kuala Lumpur, MY)
Posted September 17th, 2008 12:37 pm (Wed)  
@ The UltraBeast,
Everything is going very smoothly now but there are a few things that I didn't take into consideration when I was designing the SQL DB structure. I would like to have a "Read more..." feature on my entries and "change theme" options. Modifying the SQL DB and PHP codes in index page right now seems too late otherwise difficult. I could have done better but I guess this is what you call it's hard to get things right the first time.


Your Thoughts
<b>bold</b>, <i>italic</i>, <a href="http://...">Click</a> tags supported.
  Nickname
 
  Location e.g. Tokyo, Japan
 
  Gravatar email (optional)
 
  Website (optional)
 

Pick an avatar if you do not have a Gravatar email
:

Do this math: 67+3 =




| About This Blog:
Shin-Otaku is a blog site belongs to the author, Divine Fang who is a super otaku wannabe. Here he shares his thoughts just about anything related to otaku in this very portal -figurines, anime, games, computing, jpop, Japan e.t.c. As of time of writing, he is especially obsessed with:

 • Ayumi Hamasaki (since 2000)
 • Tekken 6 (hard-core player)
 • Suzumiya Haruhi's figures (all his figures)
 • Learning Japanese

Set your screen resolution to 1280x800* or above to view this site in its full glory!!!

Follow me on Twitter.



| Blogroll:
Real Life Buddies:
 • Anechoic 
 • I, UltraBeast
 • Jimmy Kecik
 • Keef
 • NCY 
 • Preston Toh  
 • Ze Hao

Online Buddies:
 • Alafista
 • Anime MMORPGS
 • Anime Raku
 • Atalude
 • Danny Choo
 • DarkMirage
 • Fabrice Requin
 • Figured's Figurelog
 • Gordonator
 • How a Girl Figures
 • Janime.tv
 • Jusuchin
 • Kirainet
 • Koi Aichaku
 • Kurogane
 • Kusakabemisao
 • Kyouran Kyodai
 • Life In Quadrant 4
 • Orange Horizons
 • Otadesho
 • Otaku Dan
 • Otaku.fm
 • Otaku's Hideout
 • Riuva
 • Sky Lounge
 • Saku's AFK
 • Shadonia
 • The Deathseeker
 • WAWAWA Wasuremono
 • Wcloudx (kumo)
 • Yumeno no Sekai
 • Zone Otaku
 • 望み - What is that you desire?

Dear all otakus, to do a link exchange, please add www.shin-otaku.com to your blogroll and contact me to have yours added here, thank you! :)

| 聞いてる音楽!
Recently listenned tracks on Winamp Pro + Gigaworks S750 7.1ch & iPod nano 8GB 3rd Gen + UE Super.fi 5 PRO:
 






Copyright © 2008- 2010 Shin-Otaku.com All rights reserved unless otherwise noted. | Contact