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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:36:09+00:00 2026-05-26T09:36:09+00:00

we have a system, based on Moodle platform, where files are referenced like this:

  • 0

we have a system, based on Moodle platform, where files are referenced like this:

http://[server]/file.php/3/LR4/info/index.html

Now, this works great, however some of our teachers by mistake used backward slashes then they organized their parts, that means, that some pages are referenced like this:

http://[server]/file.php/3/LR4\info\index.html

That worked fine while we were using Windows Server+IIS. However, then we switched to Linux+Apache, Apache does not seem to handle them correctly. In other words, it does not display images placed on the page, since their urls are relative, and Apache cannot reconstruct the full URL, if the base url contains backward slashes. So the page is just text, no pictures.

If I replace manually the backward slashes to direct in URL in browser address line, everything still works fine. However, we have too many pages like that. We need something to rewrite URL. I thought of Apache mod rewrite. What I basically need is three lines in code:

RewriteEngine on
RewriteCond %{THE_REQUEST} [???]
RewriteRule ??? [R]

What I need is the regular expression for RewriteCond that would make the engine react just for the URLs that contain phrase file.php and some backward slashes after that. And for the RewriteRule I need something that would replace at least one backward slash with direct (leaving everything else untouched) and make a redirect after that. But I can’t seem to construct the correct expressions – can anyone help?

  • 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-26T09:36:10+00:00Added an answer on May 26, 2026 at 9:36 am

    If you’re set on doing something through .htaccess then the following should work.

    RewriteEngine On
    RewriteRule ^(file.php[^\\]*?)\\(.*?)$ $1/$2 [R=302,L]
    

    Another option would be to edit the file.php script and translate all ‘\’ to ‘/’ in the PATH_INFO or REQUEST_URI variables or however it determines which file to display.

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

Sidebar

Related Questions

At my current job we have a CMS system that is .NET/SQL Server based.
I have following problem. I want to create a file system based session storage
I have a system where people inputs some words and based on this I
I have an upload system based on SWFUpload which calls PHP script. The problem
I have a CI System setup based on Jenkins on a Windows 2003 server
I have to control access to a system based on fingerprint recognition in PHP
Is there any file system based B+ Tree implementation in c#(open source). I have
We have hibernate-based system and customer wants to get human-readable names of PK and
I have a J2EE-based system which is running currently on Apache Tomcat. We are
We have a Hibernate based system with Annotations. Our entities have a custom property

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.