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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:31:52+00:00 2026-06-02T23:31:52+00:00

I have the current situation in my web application: The html files, will request

  • 0

I have the current situation in my web application:

The html files, will request images from the let’s say {currentpath}/images/

Because of using an MVC my URL’s change often:

domain.com/app/main/welcome/

(to get the welcome method from the main class)

In this situation, the view will request images from

domain.com/app/main/welcome/images/

I would need that in any situation, if a script calls for something from it’s images subfolder, to be redirected to a fixed folder (let’s say domain.com/app/images/).

So far, I have tried this:

RewriteRule ^(.*)/app/(.*)/images/(.*)$ $1/app/images/$3 [R=301,L,QSA]

Which doesn’t work.

My intention is to redirect:

domain.com/app/{anything}/images/ 

to

domain.com/app/images/{the requested image}

It is my first post in stackoverflow, usually I find all the answers straight by search, but on this I don’t know how to do it.

Btw, I know I could simply do a replace_all on all my views with the fixed path, but as it might change in the future, this would be a much more elegant way.

  • 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-02T23:31:55+00:00Added an answer on June 2, 2026 at 11:31 pm

    You can try:

    RewriteRule ^/?app/.+/images/(.*)$ /app/images/$1 [R=301,L,QSA]
    

    You might want to decide on how you want the urls to permanently be though and just change the redirects to match and just change the rest in the background. You might want to consider Alias as well:

    … where {currentpath} has to be filled in

    Alias /app/{currentpath}/images /app/images
    

    or AliasMatch

    AliasMatch ^/app/.+/images(.*) /app/images$1
    

    and then change the last part when the folder changes, you can also permanently redirect through mod_alias although it’s a little different:

    Redirect 301 /app/{currentpath}/images http://domain.com/app/images
    

    There is also a RedirectMatch as well.

    See: http://httpd.apache.org/docs/2.0/mod/mod_alias.html

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

Sidebar

Related Questions

let me explain my current situation i have a SharePoint site lets say it
I am developing a web application in asp.net vb. My current situation is, I
Let me describe my situation: We are developing a web application that creates websites.
I've the current situation: Have a Link in some HTML page. When the user
Here's the situation: - I have <customErrors mode=On defaultRedirect=error.html /> in my web.config. I
My current situation is: I have to read a file and put the contents
As a beginner in Ocaml, I have this current working code: ... let ch_in
I'm using Ruby on Rails to develop a web application. I have a wiki
Here is the situation: We have to build a system made of web services
For a current project, we're designing a client desktop application that parses text files

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.