how can genrate different URLs but showing same html page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rahullko05
    New Member
    • Oct 2008
    • 34

    #1

    how can genrate different URLs but showing same html page

    Hi, I am developing forum website as my final year project. I am having problem in generating different URLs but keeping the same page..

    Scenario: I am showing threads for different languages in different page, but since format of data is same for threads of all the languages, so what i planned was, to write one single xhtml page, which will be populated by data at run time using php/mysql. but i want to show different URLs for different languages thread, even when same html page is called.



    i am taking the reference of bytes.com only for this design. please let me know if my understanding is wrong about design.

    i would be really grateful for any help in this.

    thanks in advance.
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    So you want multiple URLs to point to the same page? How would the URLs be set up?

    I still don't fully understand 'showing different languages in different page'. Can you explain?

    Comment

    • rahullko05
      New Member
      • Oct 2008
      • 34

      #3
      yes exactly, i want to generate different URL for same page, containing different data at different instances.

      sorry if i confused you earlier.

      Comment

      • TheServant
        Recognized Expert Top Contributor
        • Feb 2008
        • 1168

        #4
        Well one way is to have multiple pages, which all include one file... So you have your main page (main.php):
        Code:
        <html>
        <head>...</head>
        <body>...</body>
        </html>
        Then all your other pages (eg. page1.php and page2.php):
        [code]<?php include( 'main.php' ); ?>[code]

        That means if someone goes to main.php, page1.php or page2.php they will all have the same content and can all be changed from one file (main.php).

        Comment

        • rahullko05
          New Member
          • Oct 2008
          • 34

          #5
          you are suggesting to have different pages with same content. but what i am looking for is 1 page with different content at different instances & have different URL at those instances.
          meanwhile i have came across a concept in PHP called search engine friendly URL, which probably solves this problem. But i am not sure about it.

          It would be really great if some one can share me a small sample code for this.

          Comment

          • TheServant
            Recognized Expert Top Contributor
            • Feb 2008
            • 1168

            #6
            The problem with your suggestion is your html referring to your dynamic page name will also need to be dynamic. Changing the page name once it has been generated is the mod rewrite commands, however I have never had a dynamic mod rewrite.
            If your one page is changing content then you will basically have 3 pages contents in one and change the page name depending on content selected. I cannot understand why you don't have 3 pages (no page re-naming) with the three different contents (no conditions) and if you want pages only to be accessable at certain times you can have a small script to forward to the appropriate page if the condition is met, rather than displaying the requested page.

            Comment

            Working...