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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:35:16+00:00 2026-06-14T15:35:16+00:00

I just started learning how to write htaccess . I got the following code

  • 0

I just started learning how to write htaccess .
I got the following code from this page, which redirects everything to an index.php file

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    public/    [L]
    RewriteRule    (.*) public/    [L]
</IfModule>

I understood all lines except ^$ public/ [L] and (.*) public/ [L].What does they mean.To me it looks like some regular epression :)..
I know RewriteRule is used for writing rules for redirecting .But what do symbols $ ,(,),., * etc. indicate ?.
When I put these lines to .htaccess I got the following error

enter image description here

But when I comment the 4th line,it is working..ie .the following code is working

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    public/    [L]
    #RewriteRule    (.*) public/    [L]
</IfModule

So what is the problem here?

  • 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-14T15:35:17+00:00Added an answer on June 14, 2026 at 3:35 pm

    i think you are inside rewrite loop like blew:
    you rewrite abc.com/anything to abc.com/public and also you are rewriting /public to /public.
    maybe you should specify which url must be rewrite . (limit your requests) like this :

    RewriteEngine on
    RewriteRule    ^$    public/    [NC,L]
    RewriteRule    ^index.php(.*)$ public/$1    [NC,L]
    

    rewrites index.php?requests to public/?requests

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

Sidebar

Related Questions

I just started learning C but I don't understand this part of the code.
I just started learning C++ and I wrote this sample program from the text
Started learning javascript yesterday at CodeAcademy and decided I could actually write code. Just
I just started learning PHP. I'm following phpacademy's tutorials which I would recommend to
I'm learning Qt. I just started to write a text editor from scratch by
I just started learning to write iPhone app (maybe a little too late) from
I have just started learning to write apps for android using Eclipse. Where can
I just started learning C++ and am currently using codeblocks. I want to write
I've started learning Lisp recently and wanted to write a program which uses gtk
I've just started learning Clojure, if I define the following map: (def distributions {:normal

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.