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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:07:32+00:00 2026-05-12T11:07:32+00:00

I have a rule, that gets up to three parts, separated by a /

  • 0

I have a rule, that gets up to three parts, separated by a / (slash).
They represent /app/controller/action, but they are optional, which means /, /app, /app/controller work as well.

The thing is, I want another rule, before this one, which would set the default app to “frontend”, and I think it should look like this:

RewriteRule ^(.*)$ frontend/$1

However, if I have the url /part1 everything is ok and it is received as /frontend/part1. However, if the url contains a / (slash), like /part1/part2 , I get a 500 internal error. If I remove this rule, the initial one works with /frontend/part1/part2, so the problem is within this rule. It seems the $1 does not accept slashes in it. Is that a known fact?

And also, I would like that this rule is not ran if the current url already starts with frontend/, I’m thinking something like this:

RewriteRule ^frontend(/.*)?$ frontend$1 [S=1]

Or could this be done more elegantly with a RewriteCond ?

Thanks!

  • 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-12T11:07:32+00:00Added an answer on May 12, 2026 at 11:07 am

    Try this rule:

    RewriteCond $0 !^frontend/
    RewriteRule .* frontend/$0 [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think this may be relatively straight forward. I have a rewrite rule that
I have the following rewrite rule that I need to alter in order to
I have a mod_rewrite rule that will send any subdomain requests to a php
With at-rules, it's possible to have a ruleset for elements during that at-rule event
I have the a rule with an action defined as follows: metric_expr : metric=NAME
I have validation rule that does not validate as true, and I can't see
One CSS rule I have learned is that you should use the relative em
I have two domains that are aliases, domain1.com and domain2.com Currently they are both
i use .htaccess and i have a rule that allow me to dynamically look
I have this rule in my .htaccess RewriteRule ^([^/\.]+)/?$ ?page=user&id=$1 [L] It rewrite a

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.