Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6894905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:50:27+00:00 2026-05-27T06:50:27+00:00

I have some PHP and HTML in the same file, and I am not

  • 0

I have some PHP and HTML in the same file, and I am not exactly sure how to make the URL appear as the name of that page.

Here is an example of what I would like to do: lets say some page id = 1 and the title of that page is HelloWorld.

Instead of site.com/page.php?id=1 I would like the url to appear as site.com/HelloWorld

But the problem I am having is that I only get to know the title of the page inside that page after I query for the title by id.

Considering the setup I described, is there a way to make the urls appear as the names of the pages? And also, if someone links to that page by using the better looking url with the name of the page instead of the id, is there still a way to get the id and by that, the rest of the page contents?

Thanks!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:50:28+00:00Added an answer on May 27, 2026 at 6:50 am

    What you need is to learn more on how .htaccess work.

    Here is a good link that got me started:

    .htaccess tricks and tips

    Update:

    Here is a very common practice in many framework where all requests are sent to index.php, and from there you use php to serve the correct page:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ http://www.site.com/index.php [L,R=301]
    </IfModule>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some PHP code that generates a calendar and then outputs html to
I have some PHP code that is designed to make a spreadsheet with formulas
Let's say I have some code like this: <html> <head><title>Title</title></head> <body> <?php if (!$someCondition){
Often when writing PHP I'll have it output some HTML like this - echo
I have the following code: <?php if ($x == 1){ ?> <b>Some html...</b> <?php
I have some PHP code that generates dynamic tables of data on the fly.
So I have some PHP code that looks like: $message = 'Here is the
I have some problems with rewriting URL-s my .htacces file: RewriteEngine On RewriteBase /bsc/
I have a live site that includes different php files depending on what page
I have a java program that generates an HTML file. The Java program takes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.