tags:

views:

49

answers:

2

Do I have to put every file in a different folder?

like:

about-us/about-us.php
profile/profile.php

etc.

or is there any other automatic solution.

I want to convert

http://sitename.com/about-us/about-us.php

to

http://sitename.com/about-us
+5  A: 

You want pretty URL rewriting

Andy
I want to convert http://sitename.com/about-us/about-us.php to http://sitename.com/about-us not about-us.html
metal-gear-solid
@jitendra: Why don't you first read and understand the page, then you'll know how to do exactly what you want.
DisgruntledGoat
A: 

If you have a directory called about-us, then you could simply create an index.php file within that directory, and by default, your .htaccess file should redirect users to the correct page.

Thus, going to example.com/about-us/ would bring the user to the same page as about-us.php. It would benefit you to do some research about 301 redirection.

http://www.tamingthebeast.net/articles3/spiders-301-redirect.htm

Basically, when Googlebot crawls your website, the last thing you want is for Google to find both copies of the page, one listed as about-us/ and one listed as about-us/about-us.php. Duplicate content is bad, and optimizing your website for search engines is really not at all that difficult to do.

Let's say you have a leaderboard page on your website with 1000 members. Instead of Google finding all leaderboard.php?user=Whatever, it would be a good idea to block that page from being accessed by Google, or else you will result in hundreds of unwanted archived pages on their search engine.

You might also want to make sure your website can be accessed either by www.yourwebsite.com or by simply yourwebsite.com, BUT NOT BY BOTH (without being 301 redirected).

Hope that helped. Happy programming!

EDIT: If you try renaming your about-us.php file to simply index.php, that would be your quick fix. Depending on your .htaccess configuration, I'm willing to bet that would be your easy fix.

Joe Majewski