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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:08:26+00:00 2026-05-13T20:08:26+00:00

I have a website that use this style : /index.php?page=45&info=whatever&anotherparam=2 I plan to have

  • 0

I have a website that use this style : /index.php?page=45&info=whatever&anotherparam=2

I plan to have pretty url to transform the previous url to : /profile/whatever/2

I know I have to use .htAccess and to redirect everything to index.php. That’s fine.

My problem is more in the index.php (Front Controller). How can I build back the $_GET["info"] and $_GET["anotherparam"] to be able to continue to use all the existing code that use $_GET[...] in their page?

Do I have to build back the GET in the header with some code or do I have to get rid of all $_GET[...] on every pages by creating my own array that will parse ever / to and assign something like : $myParam["info"] = "whatever" and than in the page use $myParam[] instead of $_GET[] ?

I would like not to modify all those pages that use $_GET[]

Edit:

My .htAccess look like:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ index.php [NC,L]

Everything that doesn’t exist go to index.php. Since I already use this structure : /index.php?page=45&info=whatever&anotherparam=2 nothing is broken. But now I will use /profile/whatever/2 and in the switch case I can determine what page to include(..) but the problem is with all GET parameters. How do I build them to have access from all page with $_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-13T20:08:26+00:00Added an answer on May 13, 2026 at 8:08 pm
    $path = ... // wherever you get the path $_SERVER[...], etc.
                // eg: /profile/wathever
    
    $segments = split ($path);
    
    $segments_name = Array ('page', 'info', 'anotherparam');
    for($i=0;$i  < count ($segments); $i++) {
      $_GET[$segments_name[$i]] = $segments[$i];
    }
    

    with this solution you have to always use the same arguments at the same position

    if you don’t want that you have two solution:
    – use path like /page/profile/info/wathever
    – use router system (for that I recommend you to use a framework instead of doing it all manually)

    edit: second solution

    $path = ... // wherever you get the path $_SERVER[...], etc.
                // eg: /page/profile/info/wathever
    $segments = split ($path);
    
    for($i=0;$i  < count ($segments); $i+=2) {
      $_GET[$segments[$i]] = $segments[$i+1];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this scenario. I have my own website, that I use as my identifier,
I have sessions that for the website and this is how i use them:
I have a website that makes heavy use of AJAX. There is an almost
I have a website that talks to a remote WCF web service. Both use
We have a tech support website/database at work that we use to record our
In this website: http://theoew.uuuq.com/portfolios/Idea/ I use Cufon to style the text for the the
For some reason my website won't use my styles! I have this in my
ok so i have this address for a part of my website, localhost:2001/?botid=Alice&template=alice and
I have inherited a web site project that makes use of a number of
Whenever I have a library that use across different websites/ applications I've always just

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.