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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:06:41+00:00 2026-05-26T17:06:41+00:00

I would like to type the following url into my browser: localhost/mydomain/about.php And have

  • 0

I would like to type the following url into my browser:

localhost/mydomain/about.php

And have apache redirect to the actual file location:

localhost/mydomain/public_html/about.php

I wrote the following .htaccess file:

RewriteEngine On
RewriteRule ^(.+)$ public_html/$1

I’m totally unfamiliar with Apache and my understanding of reg expressions is very basic – but I thought this would mean “Take any path after the domain name and stick public_html/ in front of it”. The result, however, is a 500 Internal Server error.

What am I missing?

  • 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-26T17:06:42+00:00Added an answer on May 26, 2026 at 5:06 pm

    This is because specifying only ^(.+)$ rule will keep the rewrite in an infinite loop.

    about.php > public_html/about.php > public_html/public_html/about.php > …

    A quick fix would be RewriteRule ^([^/]*)$ public/$1. or you might be interested with the LAST modifier/flag for rewrite rule:

    RewriteRule ^public/(.*)$ public/$1 [L]
    RewriteRule ^(.*)$ public/$1
    

    Just in case you would like to know the way of debugging the rewrite_module, you can set LogLevel DEBUG in httpd.conf, then you can check on the apache error log.

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

Sidebar

Related Questions

I have the following jQuery script: $(document).ready(function() { $.ajax({ url: 'temp.ajax.php', type: 'GET', success:
I would like to have a TextBox that supports AutoComplete and lets users type
I have the following Jquery ajax call but would like to put as the
I have the following code multiple times: $.ajax({ type: POST, cache: false, url: url
I have the following line of PHP code which works great: exec( 'wget http://www.mydomain.com/u1.php
I have an array structure like the following: I would like to have the
I am creating a PHP site and have ran into the following problem, i
Would like to know the c# code to actually retrieve the IP type: Static
I would like to create an object of Generics Type in java. Please suggest
I would like to create a custom data type which basically behaves like an

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.