homepage Welcome to WebmasterWorld Guest from 54.204.141.129
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
How to hide the website address
hihidavid




msg:4155209
 11:11 am on Jun 19, 2010 (gmt 0)

Hi,

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




msg:4155230
 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




msg:4155384
 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




msg:4163280
 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




msg:4163316
 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




msg:4163331
 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




msg:4163606
 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




msg:4163687
 8:59 pm on Jul 2, 2010 (gmt 0)

Using extensionless URLs with a matching rewrite is the way to go.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved