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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:44:51+00:00 2026-05-20T06:44:51+00:00

I have a bunch of files in the web root: – /abc-674.php /def-643.php etc.etc.

  • 0

I have a bunch of files in the web root: –

/abc-674.php
/def-643.php
etc.etc.

I want to show these when the following URL’s are requested, without changing the URL in the browser: –

/products/abc-674/this_can_be_anything.php
/products/abc-674/or_this.php

both redirect to /abc-674.php, and

/products/def-643/this_can_be_anything.php
/products/def-643/or_this.php

both redirect to /def-643.php.

So, basically, the bit between products/ and the next / is the target, while anything after that can effectively be ignored.

If it matters, I’ve already got a little code in my .htaccess to direct all traffic to my preffered domain (with www): –

# Direct all traffic to domain.com
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC] 
RewriteCond %{HTTP_HOST} !^domain$ [NC] 
RewriteRule ^(.*) http://www.domain.com/$1 [R=301,L]

EDIT: To clarify – the 2nd last line in the above is because I access the site on my dev server via http://domain/ only, and so don’t want that rewrite to apply for those requests. I do, however, want this new rewrite to apply to all requests.

Any help greatly appreciated!

  • 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-20T06:44:52+00:00Added an answer on May 20, 2026 at 6:44 am

    I think, you can use the next rule in .htaccess:

    RewriteRule ^products/([\d\w]+)/(.*)$ /$1.php
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of dynamically created *.BAT files. These BAT files are used
I'm building a web app in Sinatra and I have a bunch of files
Currently I just have a bunch of php files sitting in folders under source
I have a bunch of files that were named in a somewhat standard format.
I have a bunch of .doc files in a folder which I need to
I have a bunch of log files which are pure text. Here is an
I have a bunch of XML files that are about 1-2 megabytes in size.
I have a bunch of MP4-Files and need to add comments to them. They
I have a bunch of pdf files that starts with a unique number. And
I have a bunch of CSV files to import and so I've created BCPFORMAT

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.