Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies


5:15 am on Dec 17, 2012 (gmt 0)

New User

5+ Year Member

joined:July 8, 2009
posts: 12
votes: 0

Hi Please help me to create htaccess file for this

converted to
www.site.com/art if 15 is the ID of art

converted to

if 25 is the ID of animation where art is the parent of animation

and so on till three level

converted to

6:04 am on Dec 17, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

joined:Apr 9, 2011
votes: 244

Uh-oh, time for the boilerplate.

:: shuffling papers ::

Why We Make You Do It Yourself

There are plenty of forums where you can post a "how-to" question and get a fairly immediate answer. The answer may even be correct. But WebmasterWorld is about teaching you how to do it yourself. That way you can roll your own htaccess-- not just for today's problem but for tomorrow's almost identical one.

Here is the analogy:

Your child's room needs cleaning. You know that you can clean it yourself much faster and better than if you have to stand over your child and force him to do it right. But if you do the "make him get it right" part often enough, you will have raised a child who knows how to clean his room-- and who will some day stand glowering over his own children in the same circumstances.

Some day, someone else will post a question in the WebmasterWorld forums and you'll say "Hey, I know the answer to that one!"

Besides, when someone with a very low post count asks a question, that person may have posted the identical question in six different forums. They grab the first answer they get, and never even come back to the others. You can understand that this is infuriating for the person who took the time to compose an answer.

Still with us? Let's have a look at what you have done so far. It sounds like the basic redirect-to-rewrite two-step. In fact I have another and much longer boilerplate about that one, so count your blessings. It's a very popular question, so the Forums should have lots of ideas to help you get started.
8:55 am on Dec 17, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
votes: 0

Unless we're talking about only a small number of URLs you'll need to rewrite the request to a special PHP script that looks in the database for the name for the ID and then sends a 301 HEADER directive.

You'll also need to modify the PHP script that runs the site to link to the new URLs from the pages of the site. Clicking navigation links within a site should never lead to a redirect.