I am going to build up a online shop and selling some products,
the site is developed using php and i would like to hide the filename of the name, e.g.
from
www.mysite.com/car/list1.php
to
www.mysite.com/car/
how can i do?
thanks
Matthew1980
12:13 pm on Jun 19, 2010 (gmt 0)
Hi there hihidavid,
The word you are after is mod_rewrite this is used to mask the technology used and is good to make urls seo friendly.
Give the apache forum a try as it is a module on there. Hope that helps.
Cheers. MRb
rocknbil
9:59 pm on Jun 19, 2010 (gmt 0)
And before you look, this is "the most common mistake" - this is backwards.
www.mysite.com/car/list1.php to www.mysite.com/car/
You write from the link, www.mysite.com/car/ to the script, www.mysite.com/car/list1.php
RewriteRule ^/car\/*$ /car/list1.php [L]
Of course, one wouldn't hard code it like that, you'd use some sort of regexp to manage hundreds of URL's with one or two lines, but that's the idea . . .
capulet_x
7:48 am on Jul 2, 2010 (gmt 0)
I just wanted to put it out there that you could design your site with CSS and use javascript to load new content into a centrally located div . Your page address will appear unchanged. and you can accomplish this without the use of frames. Just a thought.
Matthew1980
9:07 am on Jul 2, 2010 (gmt 0)
Hi there capulet_x,
>>I just wanted to put it out there that you could design your site with CSS and use javascript to load new content into a centrally located div
Interesting, though I would think a tad impractical, especially when you consider that a lot of people nowadays turn of JS because of all the pop-ups and other intrusions that come from sites, the easiest way to go with this is from a server-side using rewrite rules.
Cheers, MRb
mack
9:59 am on Jul 2, 2010 (gmt 0)
also, by having all pages loaded onto one page, how would search engines be able to crawl the specific pages, when they all use the same address in the url bar. Use a method where each page has a unique url.
Mack.
capulet_x
6:44 pm on Jul 2, 2010 (gmt 0)
I agree with you guys and I admit that there was a trade-off with the proposed solution. I think that is why I hesitated to post it but I know I've also been in situations where I just need to have something online even if I had to continue developing it to function optimally. That being said, I haven't had the same experience in my browser choices with pop-up issues or unwanted javascript executing and so it didn't occur to me that "a lot of people nowadays turn off JS" but I will consider that factor in the future.
g1smd
8:59 pm on Jul 2, 2010 (gmt 0)
Using extensionless URLs with a matching rewrite is the way to go.