views:

22

answers:

1

Hello.

I have a homepage, for example: www.example.com.

There is a url like this:

www.example.com/subdirectory/page.php?var1=A&var2=B

It's a long url, so I changed it like this:

www.example.com/subdirectory/page/A/B

as well as I config the .htaccess file:

<Files page>

ForceType application/x-httpd-php

</Files>

However, I assume it's also quite long. If the "page.php" change to "index.php", the "page" seems to disappear, just like this:

www.example.com/subdirectory/A/B

But I don't know how to achieve.

Is omitted 'page' possible? How can I just do it?

Thanks for your help.

A: 

I would recommend using mod_rewrite for this. It will allow you to present a pretty URL to users and then rewrite it in Apache. You could use www.example.com/subdirectory/page/A/B on all pages and then rewrite it to www.example.com/subdirectory/page.php?var1=A&var2=B internally.

Chris
Chris, you're right. However, if using `mod_rewrite`, it's a 'redirect'. I still have a long url. I don't think it's a friendly url for SEO. Actually, using the .htaccess I've written above, you can get a shorter url, as well as be detected by search engine. thanks your answer.
sirius