Forum Moderators: phranque
Site Architecture
Content Management
Intermediate Ideas
Have any other tips feel free to add them.
Common Include Files
/php-includes/
/php-includes/home.htm
/php-includes/footer.htm
/iframe
/etc
Do not use /ads, /ad, etc to store all your banners and ad images in them. Most good ad blocking software autoblocks any files from these types of directory names, so rename these folders to something that won't trigger any kind of filters.
two things.
1. why not use mod-rewrite to make all pages have a .html extension?
2. if one does wish to display an email link, use hiveware's enkoder. it works wonderfully.
Also if you usually setup sites using a certain cms, I'd suggest creating several basic templates (ie. 2 column, 3 column, header/footer/2 columns..etc) so that you always have the basic framework and css hacks done.
From day one use organic file references when linking to any other page or file on your site. This will save you hundreds of hours if you decide to move a page somewhere.
Example:
<img src="http://www.domain.com/images/test.gif">
This is a static file reference. Change it to this:
<img src="/images/test.gif">
Doing so means the exact same thing code-wise, but if you have to move this specific page to another folder you won't have to change any of the css, image, or link references.
Also, set up ww.example.com and wwww.example.com so they resolve to your real URLs.
<<<
Control your included files
Wouldn't it be nice to just include() your files and never have to worry about the path? You set it once when you setup a new site and be done with it. A lot of programmers use this technique, you'll often see it called the "config.php" script or something similar. Here's a sample to get you started (replace the bold path with the path to your includes directory):
ini_set('include_path', realpath($_SERVER['DOCUMENT_ROOT'] . '/../includes/') . '.' . PATH_SEPARATOR . ini_get('include_path'));
Some pretty neat stuff going on in here.
First, notice the use of the realpath() function to put the canonicalized absolute pathname together from a relative link (/../includes/), which by the way, resides below the public document root ;) -- tidies it up quite nicely.
Second, we concatenate the current server configuration include_path to the end of our include_path. Why? In case you want to use any existing paths, such as PEAR classes.
Lastly, notice the use of the PATH_SEPARATOR predefined constant? That way you can use it on a Windows server or a *nix server without having to modify anything.
>>>
1. why not use mod-rewrite to make all pages have a .html extension?
Because then you are encoding things into the URL. What happens when you move from HTML to XHTML? They are very different, and have different mimetypes. Either you change all your links or live with misleading URLs. The type of the resource on the end of a URL should be in one place, and one place only - the Content-type mime header.
besides that...it looks really wrong in my opinion
I'll use my website, under development for over 6 months now, as an example if I may.
for an example, a URL to a movie (i am making a asian cinema database, PHP/ MySQL) is http://db.example.com/?mid=251
traditionally, people would use http://www.example.com/db/index.php?mid=251
now look at the 2 above eachother
http://db.example.com/?mid=251
http://www.exampe.com/db/index.php?mid=251
in my opinion, the top one looks much more informative and is easier to read and remember.
a url to a topic in my forums is something like:
http://bb.example.com/view/?tid=2
using folders for names that describe actions is something one doesnt see very often too, but I think some people may like this to
added to that are the benefits listed in the initial post :)
hope I made some sense, Im no professional webmaster...but I am motivated :)
mmm, wrong quote, sry about that
[edited by: tedster at 10:10 pm (utc) on Jan. 16, 2005]
[edit reason] use example.com [/edit]
example.com/db/index.php?mid=251 can be transformed into:
example.com/movies/251 or even better, by using a more meaningful URL instead of the number:
example.com/movies/titanic You can use mod_rewrite to resolve the static URL to the appropriate variable for your database.
One questions: Do you know of any scripts that do all of the functions you are describing for "Links Trades". I can't find any that has all the features, especially the one that checks for the reciprocal link, identifies that it is missing, and sends out e-mails/removes them from the directory.
How about maintaining foreign language versions? Uploading content in one language and having it appear in all languages simultaneously?
If that is not possilble because your content is too broad, then perhaps a panel for translators to use so you don't need to manage the content yourself?
And keyword management? It's always good to have a keyword database so you get a good overview and control of what pages your keywords are on. Does your keyword management also handle the internal anchor text on your site? Is it easy to use?
Visitor and ROI tracking - always better if it's in house. If you automate it it's much better than trawling the site logs :)
Dynamic content upload - is your site completely dynamic? Can you add new categories or topic areas as well as simple additions like products without programming work? In all languages?
Customer management - do you manage them all in your database? If you can it saves a hell of a lot of paperwork and allows much better stats delivery.
Special offers - can your database generate them based on your inventory/pricing/demand/seasonal information? Or do you need to hard code offers onto your site? If you have more than one site this can get very time consuming.
Landing pages for pay-per-click - these will save you considerable time in managing your paid traffic.
I have not got round to adding half of the above, but when I do I will have a little more free time than I do now :)
One questions: Do you know of any scripts that do all of the functions you are describing for "Links Trades". I can't find any that has all the features, especially the one that checks for the reciprocal link, identifies that it is missing, and sends out e-mails/removes them from the directory.
I couldn't find one either, so I wrote my own in PHP/mySQL.
One issue though, from SearchEngineWorld's The Robots.txt Our Big Crawl [searchengineworld.com]:
An easy way for search engines to detect server or domain farms (huge groups of sites), is to look at the robots.txt. We found huge farms of 400-500 domains that were all using the same unique robots.txt file. That alone is a tip off to search engines that the sites are all related.
Depending on how many layers of tin foil you use for your hat, you may wish to make each site unique in ways that eliminate the use of some of the described methods.
With ASP, PHP, etc. this is not relevant, so I agree with you completely there.
it's helpful for them to be able to distinguish [example.com...] from [example.com...] which they can't do if the URL is just [example.com...]Can anyone else share their experience with "http://example.com/blah/page.html" vs "http://example.com/blah/page"? I am about to make this call and I am trying to decide what re-write would be better. Doesn't .html just feel more soothing ;)
Thanks!
Create your own log files with a server side language if you have a host that does not update your log file in real time. You can even create a log file for each site section.
Use includes as much as possible.
Can anyone else share their experience with "http://example.com/blah/page.html" vs "http://example.com/blah/page"? I am about to make this call and I am trying to decide what re-write would be better. Doesn't .html just feel more soothing
Here is sort of how I do it,
example.com/dictionary = example.com/page.php?page=dictionary&letter=a
example.com/a = example.com/page.php?page=dictionary&letter=a
example.com/b = example.com/page.php?page=dictionary&letter=b
example.com/news = example.com/page.php?page=news
example.com/news/2004/12 = example.com/page.php?page=news&year=2004&month=12
and so on...
Off topic,
The file page.php looks something similiar to,
<? include('content/'. $page .'/setup.php');?>
The content folder is 'deny from all'
Almost nobody, besides us, have any idea what .html, .php, .asp or any of the rest mean. Here is the google address you get by typing in 'big long search about nothing',
ht*p://www.google.com/search?num=50&hl=en&lr=&safe=off&q=big+long+search+about+nothing&btnG=Search
Take that out on a street corner and see how many people can decipher it? Most places have such long address's the end is cut off from view in the address bar anyway, adding an .html to the end just adds to the length.
Try this example, ask some non techie freinds or family (mom or grandma) to guess what the following mean,
example.com (might say, website?)
example.com/dictionary (maybe, website and something to do with a dictionary?)
example.com/dictionary/c (website with something about dictionary and the letter c in the dictionary?)
example.com/dictionary/c.html (you see where I am going with this)
In my opinion, anything you can do to make your address short, simple and to the point is the best choice. Your probably the only one thats even going to pay attention to it anyway. If your lucky enough to get people to come to your website, and on top of that, have them use your address bar to open a page on your site, do you really want them to make five extra keystrokes to type in .html?
P.S. I'll bite, what does this mean,
If you see someone with an “allin” in the referrer record their IP and pages they visit.
Did a search on google and webmasterworld and came up with nothing, what is allin?