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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:34:47+00:00 2026-05-13T09:34:47+00:00

Not sure how you’ll take this question but… Whenever I try to make my

  • 0

Not sure how you’ll take this question but…

Whenever I try to make my URLs look pretty I always end up messing around for too long and it’s simply not worth the trouble. But the end effect is good if it were a simple task.

So what I want to do is create a method which in the end would achive something like…

index.php?do=user&username=MyUsername //This becomes...
/user/MyUsername //...that
index.php?do=page&pagename=customPage //And this becomes...
/page/customPage //...that
index.php?do=lots&where=happens&this=here //This also becomes...
/lots/happens/here //...that
index.php?do=this&and=that&that=this&and=some&more=too //And yes...
/this/that/this/some/more //This becomes this

So then I just make a nice .htacess file that I’ll never have to look at again. Everything will be better in the world because we have pretty URLs and my head didn’t hurt in the making.

  • 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-13T09:34:48+00:00Added an answer on May 13, 2026 at 9:34 am

    You can use a different approach of throwing the url in a single parameter, and parse it in your application.

    So the apache rewrite rule would look like:

      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    

    which will convert your urls as follows:

    /user/MyUsername => index.php?q=/user/MyUsername
    /page/customPage => index.php?q=/page/customPage
    ...
    

    In your app, you then have a $_GET[‘q’] variable, which you can split by ‘/’, and have your arguments in order. In PHP it would be something like:

    $args = explode('/', $_GET['q']);
    

    $args will be an array with ‘user’, ‘MyUserName’, etc.

    This way you will not have to touch your .htaccess again, just your app logic.

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

Sidebar

Related Questions

Not sure how to ask this, but i'll give it a try: I have
Not sure if this is too open-ended of a question for StackOverflow but, I'm
Not sure why the plugin is behaving this way but whenever I refresh the
Not sure if this belongs here because its not technically a 'programming' question, but
Not sure if this is a basic question or not but I can't seem
Not sure where to post this question, but I am concerned about the security
Not sure if this is the right place for MDX question but it seemed
Not sure how I can reproduce this one in jsFiddle but I will try
Not sure this is a programming question, but we use LaTeX for all our
Not sure if I'm asking this question properly, but here's what I'm trying to

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.