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

  • Home
  • SEARCH
  • 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 7406819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:36:54+00:00 2026-05-29T05:36:54+00:00

I am trying to rewrite a URL with .htaccess and had a question that

  • 0

I am trying to rewrite a URL with .htaccess and had a question that I’m unable to find an answer to after many hours of searching. And, it doesn’t help that my regex skills aren’t that great…

The underlying format for my URLs is this: http://mysite.com/article.php?id=1.

I would like to have a URL like this direct there: http://mysite.com/article/1/made-up-irrelevant-title-slug.

The problem is, I’d like the article to be a variable such that it could be changed to page and would direct to something like: http://mysite.com/page.php?id=1, from http://mysite.com/page/1/made-up-page-name.

If anyone knows how this is properly written, I would be extremely grateful!

  • 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-29T05:36:55+00:00Added an answer on May 29, 2026 at 5:36 am
    # Turn on Rewrites
    RewriteEngine on
    
    # Do not rewrite existing files, directories, or symlinks.
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    
    # Rewrite /COMPONENT/ID/TITLE -> COMPONENT.php?id=ID
    RewriteRule ^([^/]+)/(\d+)/.*$ $1.php?id=$2 [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to rewrite a URL using .htaccess. I am running on Apache
I am trying to rewrite a url so that all requests for /admin get
I'm trying to create a rewrite condition in .htaccess file to check if url
Trying to htaccess rewrite old-url-part/qwerty/999-yuiop ...to... new-url-part/yuiop-999/qwerty RewriteRule ^old-url-part/(.*)/([0-9]+)-(.*)/?$ /new-url-part/$3-$2/$1/ [R=301,L] The following part
I'm trying to find a htaccess rewrite to remove www. from https: pages only.
I'm trying to implement a REST-style URL with a mod-rewrite turned on in .htaccess.
I am trying to rewrite the URL of a CodeIgniter application, though it doesn't
I'm trying to make user friendly URL using mode rewrite. My problem is, that
When i was trying to rewrite url using .htaccess i got my page css
trying my .htaccess page to rewrite this url www.mywebsite.com/view.php?2012/this-is-page.html to www.mywebsite.com/view.php/2012/this-is-page.html Where view.php is

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.