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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:40:45+00:00 2026-05-23T01:40:45+00:00

My environment is Apache, DB is mySQL and language is PHP. What I need

  • 0

My environment is Apache, DB is mySQL and language is PHP.

What I need is to create a middle layer which intercept the request and check the urls such as "http://www.something.com/apple/ipad-2-cases/" and then look up the db and where both apple and ipad-2-cases has a counter such as below:

Products Table

  1. p_id –> 1
  2. p_name –> “iPad”
  3. p_custom_url –> “ipad-2-cases”

Brands Table

  1. b_id –> 2
  2. b_name –> “Apple”
  3. b_custom_url –> “apple”

and convert the url into "http://www.something.com/products.php?b_id=2&p_id=1" from where I can grab b_id and p_id to bring out appropriate product info.

It basically quite looks like the way implemented in Joomla. You can define your own user-friendly url by typing an extra field otherwise it implements default setting anyway.

Since I am new to PHP, I don’t quite know how to accomplish this. IN asp.net I’ve been using URL-Writer library which uses HttpHandlers and HttpModules to intercept the current request and make proper replacements.

Is there any library or something out there which can help me out on this one? Or do I need to use .htaccess (I know I need to turn on the mod_urlwrite on .htaccess)

Thanks a lot.

  • 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-23T01:40:46+00:00Added an answer on May 23, 2026 at 1:40 am

    Instead of ids, use names.

    Using mod_rewrite in .htaccess go from

    http://www.something.com/apple/ipad-2-cases/ 
    

    to

    http://www.something.com/products.php?b=apple&p=ipad-2-cases
    

    and find the relevant ids inside products.php

    EDIT
    In .htaccess create a rule like this:

    RewriteRule ^[^/]+/([A-Za-z_-]+)/([A-Za-z_-]+)$ products.php?b=$1&p=$2 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My Environment: I'm using: OpenSuse 11.4 kernel 2.6.x.x; Apache 2.2; PHP 5.3; MySQL 5.5
I need PHP 5.2.13, MySQL 5.0.77 and Apache 2.2 running on Windows to replicate
There is site http://abc.com (made in PHP, MySQL, Apache, Linux environment). Currently, MySQL on
how in lamp (LINUX ,APACHE ,MYSQL ,PHP) environment , can i show date and
My development environment: Ubuntu 9 Ruby 1.9.1/1.8.7 (rvm) Rails 2.3.5 Mysql 5.0 Apache Passenger
i have a LAPP (linux, apache, postgresql and php) environment, but the question is
I need a program that create a web-like environment (like easyphp does) but without
I am very experienced in working with open-source technologies like PHP, MySQL, Apache and
Is the LAMP (Linux, Apache, MySQL, PHP / Ruby / Python) stack appropriate for
I've got a Windows 7 machine upon which I do both PHP/MySql Dev, 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.