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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:31:16+00:00 2026-05-24T21:31:16+00:00

I’m currently using Apache 2.2 I can do simple things like RewriteRule ^/news$ /page/news.php

  • 0

I’m currently using Apache 2.2

I can do simple things like

RewriteRule ^/news$ /page/news.php [L]
RewriteRule ^/news/(.*)$ /page/news.php?id=$1 [L]

but what if I want to send 2 parameters like this

http://www.example.com/link/param1/param1_value/param2/param2_value

Lastly, I want to also know implementing SEO friendly URL like stackoverflow

though I can get access to a page with URL like

http://www.example.com/doc_no/

Just decorating that URL with

http://www.example.com/doc_no/this-is-the-article

Give me some suggestion with example snippets.

  • 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-24T21:31:18+00:00Added an answer on May 24, 2026 at 9:31 pm

    I know that the PHP symfony framework allows you to do that.

    How does it work :
    In apache config, use mod_rewrite to redirect ALL incoming resquest to a single entry point (in symfony this is called the “front controller”)

    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteRule ^(.*)$ index.php [QSA,L]
    </IfModule>
    

    In this front controller you are going to create a “Request” object which holds all the informations provided by the URL.

    For example you could say that the first thing after the “/” is the name of the PHP file to call and everything else are parameters and values so that :
    http://example.com/file/id/2 will call file.php with id=2

    To do that, just use some reg exp and design you “Request” class carefully. For the example above the “Request” class should provide both getRequestedAction() and getParameter(string parameter) methods. The getRequestedAction() method will be used when the “Request” object is fully populated in order to call the correct file/action/method.

    if you choose to populate the parameter array of the request object with both reg exp on the URL and a parsing of the _GET array, you may get to the point where :
    http://example.com/file/id/2 is the same as http://example.com/file?id=2
    (and both can work)

    you can choose to ignore extensions (http://example.com/file.html is the same as http://example.com/file), or not.

    Finally, for some URL, you can choose to just ignore everything that goes after the last ‘/’. So that : http://example.com/question/3/where-is-khadafi is the same as http://example.com/question/3/is-linux-better-than-windows

    In the different file.php, just use $request->getParameter(‘id’) to get the value of the “id” parameter, instead of using the _GET or _POST arrays.

    The whole point is to

    1. Redirect all incoming traffic to a single “front controller”
    2. In that file, create a “Request” object that contains all the informations needed to run the site
    3. Call the correct action (php file) based on the informations contained in that “Request” object
    4. Inside the actions, use this request object to fetch the parameters contained in the URL

    Hope this helps

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

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I would like to count the length of a string with PHP. The string
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.