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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:20:40+00:00 2026-06-10T06:20:40+00:00

I have a file in a folder like this folder1/folder2/folder3/filename.htm . I also have

  • 0

I have a file in a folder like this folder1/folder2/folder3/filename.htm. I also have another file like this folder1/folder2/folder3-filename.htm. When i browse the url mysite.com/folder1/folder2/folder3/filename.htm, i want the folder3-filename.htm will be served (displayed)

I know some basics about file name rewrite rules, but i have not seen any mixed-up combination of folder name and file name in that way.

Could anyone help me how to do it?

  • 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-10T06:20:41+00:00Added an answer on June 10, 2026 at 6:20 am

    Using the expression [^/]+ to match all characters up to but not including the the next / and then .+ to match everything after the last /, the following will work:

    RewriteEngine On
    RewriteRule ^folder1/folder2/([^/]+)/(.+)$ folder1/folder2/$1-$2 [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this folder1/folder2/folder3/13007805372971.jpg What should I do to append a
I have a directory that looks like this: pages/ folder1/ folder1.filename1.txt folder1.filename2.txt folder2/ folder2.filename4.txt
Do I have to put every file in a different folder? like: about-us/about-us.php profile/profile.php
My situation is simple. I have this in my program: File folder = new
I have a file that contains filenames like this: my_cool_file.xxx my_cool_file2.xxx my_cool_file3.xxx I have
i have a sub that looks like this: Sub open_esy(filename, p As String, p1
I have a list of filenames in a text file like this: f1.txt f2
I have this applescript that takes the selected item and zips that file/folder and
I have a .csv file with data like this: uc007ayl.1,ENSMUSG00000041439 uc009mkn.1,ENSMUSG00000031708 uc009mkn.1,ENSMUSG00000035491 I have
I'm using Core Data and I have a file-folder tree-like structure. So I've created

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.