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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:25:51+00:00 2026-06-04T04:25:51+00:00

I have a page which is www.example.com/page_name.php?var1=dynamic_var1&var2=dynamic_var2 I want to use .htaccess file to

  • 0

I have a page which is http://www.example.com/page_name.php?var1=dynamic_var1&var2=dynamic_var2

I want to use .htaccess file to make it look like this
http://www.example.com/page_name/dynamic_var1/dynamic_var2

I have tried this so far

RewriteRule ^page_name/(.*)/(.*)$ page_name.php?var1=$1&var2=$2 [NC]

and the problem is when this is going to database it goes like this

SELECT * FROM table_name WHERE id=dynamic_var1/dynamic_var2.php/dynamic_var1 LIMIT 1

and i also tried this

RewriteRule page_name/(\w+)/(\w+) page_name.php?var=$1&var2=$2

it is loading the page but without any pictures or css file or anything, and when i used firebug it said that it failed to load the URL given.

and when i tried this

RewriteRule ^page_name/(\w+)/(\w+)$ page_name.php?var=$1&var2=$2

It gave me internal server error

Thanks in advance,

  • 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-04T04:25:52+00:00Added an answer on June 4, 2026 at 4:25 am

    Don’t try split the URL from within the .htaccess file. Why don’t you try simply passing the entire query string to your index.php or any other script you want and parse the request there…

    RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
    

    A much easier way would be to simply redirect all the requests into an index.php file that does something like this –

    index.php –

    Given http://yourdomain.com/user/123

    $originalURL = $_GET['url'];
    $URLParts = explode('/',$originalURL);
    

    Now you have inside of $URLParts

    Array (
     'user',
     '123'
    )
    

    Now you can easily place these values in your SQL query.

    Watch out for SQL injection though! always use mysql_real_escape_string() and make sure to sanitize any incoming data…

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

Sidebar

Related Questions

For example I have a website that points to a page like this: http://www.mysite.com/folder/file
Currently I have a page residing at: http://www.example.com/site/page In my htaccess I have the
For example I have this address: http://www.domain.com/page/ page-name page-name is always changed, by the
So, I am trying to make: sub.example.com/page rewrite to www.example.com/sub/page I have this code
I have an anchor tag which i want to use to go to a
I have an XML file which I want to parse(below). I used an example
I have implemented exactly the code which is shown on this page: http://developers.facebook.com/docs/reference/dialogs/feed/ Problem:
I have a webpage (say www.example.com/a.asp) .. I am having an iframe in this
I have page register.php, which is used to get user informations, after completion of
I have page which is redirected from htaccess. now I can pass the German

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.