Forum Moderators: mack

Message Too Old, No Replies

Url to full address or relative?

         

kernoman

7:27 pm on Sep 5, 2005 (gmt 0)

10+ Year Member



Hi,

I am new to web design and have created a site which all runs off the index.php page, when the user clicks on a menu item it just passes 'index.php?page=thepage.html' and the page is displayed. Throughout the pages on the site there will be url's embeded in the page which will take the user off to another page, my question is should these url's follow the same format as my menu and pass 'index.php?page=thepage.html' or should it do the full url to the page including the site name?

Also if all my site runs from the index.php page and the html files are just in the root of the site will this get indexed correctly by a search engine? should I also add meta data to each page even though I hav included it on the index.php page which gets output on every page generated.

I hope I have explained that clearly enough and that some one can advise.

Thanks for reading.

txbakers

9:29 pm on Sep 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi and welcome to the Webmaster World!

My first question is WHY would you want to do this:

a href='index.php?page=thepage.html'

When you could just as easily do this:

a href='thepage.html'

?

Is there a reason you are sending the new page as a parameter?

kernoman

10:06 am on Sep 6, 2005 (gmt 0)

10+ Year Member



Hi,

The reason I am passing 'index.php?page=thepage.html' rather than just 'thepage.html' is because the menu and site look for the value held in the page variable, is there a better way?

Thanks

kernoman

11:14 am on Sep 7, 2005 (gmt 0)

10+ Year Member



I take it what I am doing is ok then as nobody else has replied?

txbakers

12:37 pm on Sep 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



because the menu and site look for the value held in the page variable

I take it then that you didn't write this routine. If you wrote it yourself you'd be able to decide the best way to go.

I think it's redundant to send the next page in a variable, when an "a href" will do the job nicely.

but if it ain't broke, don't fix it.

kernoman

2:19 pm on Sep 7, 2005 (gmt 0)

10+ Year Member



No I did write the code myself, it all works fine on my development box and the reason I was asking for advice is that when I upload it to the hosting site I want to ensure that it works ok (this I can test no problem) and that it gets indexed by a search engine (this I have no clue about).

The code I wrote checks for the current page value as it then highlights this as the active page in the menu (its a php expanding menu). Without doing this when a user clicked on a link to open a page the link would not look like it had been visited or was the active link, as I am new to web development I may have got this all wrong and made it harder for myself but it seems to work nice. So back to my original question ' should i put the full site address in the url's or is it ok just to do 'index.php?page=thepage.html' I take it search engines will be fine with this?

Thanks for the advice its appreciated.

txbakers

2:57 pm on Sep 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you're fine.