PDA

View Full Version : Site architechture question re: SEO



Reggie_Schultz
October 19th, 2009, 10:28 AM
Hi all,

I am developing a simple XHTML/CSS site (using some small php require functions). I am looking at the simplest way to create clean URLs. I am considering putting each page in it's own folder, using an index.php in each folder. The resulting URLs should be:

www.website.ca/Home/
www.website.ca/About-Us/
www.website.ca/Contact-Us/
...etc...

My question is about the SEO of this method. It will leave very attractive, human-readable URLs, but will I compromise anything in SEO with only index.php files throughout the site?

Thank you!

simplistik
October 19th, 2009, 11:32 AM
My question is about the SEO of this method. It will leave very attractive, human-readable URLs, but will I compromise anything in SEO with only index.php files throughout the site?

Thank you!

No search engines don't care, and they don't know which file is being served up to display content either. But I will say that's a very poor way to handle canonical URLs

Reggie_Schultz
October 19th, 2009, 02:15 PM
No search engines don't care, and they don't know which file is being served up to display content either. But I will say that's a very poor way to handle canonical URLs

Okay, sounds like you have a strong opinion on the subject! Care to say more?

simplistik
October 19th, 2009, 03:22 PM
Canonical URLs are controlled by the .htaccess rules not by folder. For example if you take many CMS' Wordpress, ExpressionEngine, Frog ... the list goes on and on. You'll see something like this in the .htaccess:



RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

or some variation of it:


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?$1 [L,QSA]


The key is that every "page" you hit gets passed through the index.php, where index.php has some processing logic going on in it that translates the URL that you're serving up into an HTML page. For example lets say you have:



http://www.mysite.com/index.php?id=1


it's canonical could be something like



http://www.mysite.com/about


what is happening is that there is some logic that is included in index.php (or one of it's includes) that says ... oh ... "about" is equal to id=1, so let me access the database, find all relevant content for page 1 and then serve it up. So instead of having physical files e.g. about.php, contact.php or in your case /About-Us/index.php and /Contact-Us/index.php you have virtual files. It's hitting the database and serving the content from the database, being displayed by a singular file or a group of files working in conjunction to create your content.

Reggie_Schultz
October 19th, 2009, 03:35 PM
Okay, I'm following you. Here's my thoughts, though.

This website will contain, in total, 16 pages. It is a static brochure website. My understanding is that the method described above (using .htaccess) is used primarily for the reason of portability and manageability.

This site is extremely manageable, and the nature of the site guarantees that it will remain static.

Modifying the .htaccess file could potentially cause problems as I have no prior experience with that. The little research I have done on the subject tells me that one should tread with caution when accessing such files.

So, realistically speaking, wouldn't my proposed method do the trick?

simplistik
October 19th, 2009, 04:05 PM
So, realistically speaking, wouldn't my proposed method do the trick?

Yea definitely would work just fine. Especially if you don't have any prior knowledge of how to do anything like that. It's just something to keep in consideration though for future projects, whether the content is static or not, it's significantly easier to port over 1 resource + db than 16 resources.

Reggie_Schultz
October 19th, 2009, 05:20 PM
Thanks for pointing me in the right direction. I would like to learn about databases and how they can help me work better. I have a project coming up that it would be significantly better for me to work that way, provided I can find some good resources to help me along.