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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:49:04+00:00 2026-06-01T18:49:04+00:00

So this is the thing, Im building dispatcher class that needs to dispatch http

  • 0

So this is the thing, Im building dispatcher class that needs to dispatch http requesd based on Request URI, so Im interesed only in part of URI that comes behind domain.

Now when im working on live server on URI like this:

www.domain.com/controller/method/params/

REQUEST_URI would return:

/controller/method/params/

But when im working on local machine i have URI like this:

localhost/project/controller/method/params/

and REQUEST_URI would return:

/project/controller/method/params/

So is there an elegant and neat way to tell php to get me only the params I need fromu URI?
It dosent have to be $_SERVER[‘REQUEST_URI’], but I need that string the same on both live and local server?

Thanks!

Dispatcher compares current request URI with URI defined in config file. And on live server it matches, but on local machine there is one segment more then on live server.

How could I deal with this?

  • 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-06-01T18:49:05+00:00Added an answer on June 1, 2026 at 6:49 pm

    Usually I configure my local webserver to respond on “test.mysite.com” and in hosts file i set test.mysite.com to 127.0.0.1, in that way i better simulate production environments, and i’m not forced to use subpaths in urls

    If you use apache webserver, you can simply setup N virtual hosts.

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

Sidebar

Related Questions

Why is this thing not working? [Database(Name=Relationships_Test)] [Table(Name = Order)] public class Order {
I have this thing that i need to do and some advices will be
We are currently building an application that needs to communicate to some IBM WebSphere
I'm building a Rails 3 application that I plan on provided as a subscription-based
WordPress has this thing that examines whether it has been set up (installed) on
Given this sad thing below, which generates all pairs of only two ranges -
This is a self-explanatory question: Why does this thing bubble into my try catch's
I have this thing working mostly. What I don't get is, if I have
Why is this thing giving the message in the second line (i.e. list convertion)?
I am confused with this thing, is emulator safe from pc network's firewall like

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.