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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:27:27+00:00 2026-06-15T17:27:27+00:00

Hello I’ve bee trying for 1 week now to fix some urls on my

  • 0

Hello I’ve bee trying for 1 week now to fix some urls on my custom built site but I can’t accomplish what I want 100%. So here is my question:

I have a php landing page that manages events the default url structure is this:

foreach($resultSet as $key => $event)
{
    echo '<a href="/event.php?eid='.$event['eid'].'&cat='.$event['categroy'].'&title='.urlencode($event['title']).'">content</a>';
}

As you can see the url format is like this

/event.php?eid=145&cat=metal&title=Great+gig

What I would like it to be through htaccess is something like this

domain.com/event/metal/Great gig

I’ve been reading htaccess guides but I cant make it work with more tahn 1 params on the url please advise, Thank you.

  • 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-15T17:27:28+00:00Added an answer on June 15, 2026 at 5:27 pm
    1. Change your php code so that it generates URLs that look like domain.com/event/metal/Great gig:

      echo '<a href="/event/'.$event['eid'].'/'.$event['categroy'].'/'.urlencode($event['title']).'">content</a>';
      

      (Note that the 'category' is mispelled in your example)

    2. Add these rules in the htaccess file in your document root, preferably above any rules you may have already there:

      RewriteEngine On
      RewriteRule ^/?event/([^/]+)/([^/]+)/(.+)$ /event.php?eid=$1&cat=$2&title=$3 [L,QSA]
      

    Additionally, if you have links that are out of your control that still have the query string, you can add these rules:

    RewriteCond %{THE_REQUEST} ^(GET|HEAD)\ /event\.php\?eid=([^&]+)&cat=([^&]+)&title=([^\ ]+)
    RewriteRule ^ /event/%2/%3/%4? [L,R=301]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I was wondering how I can setup several things in a constructor, but
Hello I'm making RSS reader and I'm using DOM. Now I stuck, trying to
Hello again; i need to show X,Y,Risk in ListBoxes. But i can not do
Hello, I want to put custom status bar in notification window of iphone. is
Hello! I've been programming for a long time but just started developing for android,
Hello i want to make animation of a frame change. But i don't find
Hello I am trying to get status of battery of the device programmatically. So
Hello I call static PageMethod from JS. PageMethod send some information to emails. When
Hello I am trying to implement a wake lock for an application. PowerManager pm
Hello I have created an application using qt and I managed to save some

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.