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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:41:16+00:00 2026-06-10T13:41:16+00:00

I have noticed that many websites use urls that end in website.com/index.php?var=value&var2=value2 and I

  • 0

I have noticed that many websites use urls that end in

website.com/index.php?var="value"&var2="value2"

and I was wondering how I could make it so that instead of having that be the end of the URL have this instead:

website.com/value/value2

and then have it so that instead of searching for “/value/value2” inside of the servers root folder it would instead just open index.php and then inside the PHP coding have a function that would get what the URL is. Either as a string “/value/value2” or an array “value” “value2” it doesn’t matter but just some way of getting those variables. This would be so that the URL could be cleaned up and easy to tell where you were in the website.

Also if there is a way of doing this would it be possible for style.php that is in the same folder as index.php (but has a PHP header setting it to output CSS) that would be called in the head of index.php using <link rel="stylesheet" type="text/css" url="style.php" /> or whatever the syntax for that is, to be able to obtain that same variable so that the css styling could be changed according to the URL.

  • 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-10T13:41:17+00:00Added an answer on June 10, 2026 at 1:41 pm

    You can use rewriting of urls in .htaccess file

    Check this.

    RewriteEngine on
    RewriteRule ^([^/]+)/([^/]+)/([^/]+) /?var=$1&var2=$2 [L]
    

    There are three parts to this:

    1. RewriteRule specifies that this is a rule for rewriting (as opposed to a condition or some other directive). The command is to rewrite part 2 into part 3.
    2. This part is a regex, and the rule will be run only if the URL matches this regex. In this case, it says – look for the beginning of the string, then a bunch of non-slash characters, then a slash, then another bunch of non-slash characters. then again bunch of non-slash characters, then a slash, then another bunch of non-slash characters. The parentheses mean the parts within the parentheses will be stored for future reference.
    3. Finally, this part says to rewrite the given URL in this format. $1 and $2 refer to the parts that were captured and stored.

    Refer Beginner’s Guide to mod_rewrite.
    Also tutorial for same.

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

Sidebar

Related Questions

I have noticed that many blogs use URLs that look like this: http://www.hanselman.com/blog/VirtualCamaraderieAPersistentVideoPortalForTheRemoteWorker.aspx I
I noticed that many websites, even Google and some banking sites, have poorly-written HTML
I noticed that many website have a nice 'feedback' button in their page. It
I've noticed that just in the last year or so, many major websites have
I have seen on many sites the silverlight video player. I noticed that all
I have noticed that most Objective-C coders never use the self->ivar syntax when accessing
I have noticed that viewing images or websites that are hosted on US servers
I'm new to actionscript and I have noticed that many variable names in actionscript
When creating a custom view, I have noticed that many people seem to do
When creating a custom view, I have noticed that many people seem to do

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.