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 550273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:16:15+00:00 2026-05-13T11:16:15+00:00

ok assume i have php page has this name name.php?get= and has get varible

  • 0

ok assume i have php page
has this name name.php?get= and has get varible named get
ok
how i can make it appear like that name?get=

  • 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-13T11:16:16+00:00Added an answer on May 13, 2026 at 11:16 am

    I’d seriously reconsider before using (or overusing) mod_rewrite.

    In almost all of my projects I use a simple mod rewrite in the .htaccess:

    RewriteEngine On
    
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteCond %{SCRIPT_FILENAME} !-f
    
    RewriteRule ^.*$ ./
    
    AddHandler php5-script .php
    

    This tells the server to forward all pages to / (index.php) unless a file otherwise exists.

    In the root directory I have a folder called “views” with all of the pages that I use. E.g. the file used for /home would actually be /views/home.php. However, in the index.php I have a script that parses the user’s url, checks for the file, and includes that.

    $page = substr($_SERVER['REQUEST_URI'], 1);
    if(!$page) :
        header("Location: /home");
    if(file_exists("views/$page.php")) :
        include "views/$page.php";
    else :
        include "views/$page.php";
    endif;
    

    This creates a variable called $page that stores the value of everything in the URL after the domain name. I use a substr() function on the Request URI to get rid of the trailing forward slash (/) on the URL.

    If the variable is empty, for example if the user is simply at http://example.com or http://example.com/ then it forwards them to /home, where the script then checks for the home.php file inside of the views folder. If that file exists, it includes it, and displays it to the user.

    Else, the script will simply include the 404 page telling the user that the file doesn’t exist.

    Hopefully this helps you, and if you need any further explanation I’d be happy to help!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume that I have 2 .php files : index.php and ajax.php This is index.php:
Say I have info.php page with user info (id, name, age, etc). On this
Assume that I have login to system using PHP + MySQL, then, after I
I have a question regarding static function in php. let's assume that I have
I have web software where I need to have URLs like this http://site.com/page/var1/val1/var2//var3/val3 Then
I have a php page that produces an array of elements. For the sake
I have a POST form in PHP that I'm converting to GET . The
I want to do something like this.. I have a update form in PHP,
Let's assume we have the following structure: index.php config.inc.php \ lib \ lib \
Assume I have two tables, Student Test Id Name TestId Type StudentId -- ----

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.