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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:17:17+00:00 2026-05-12T08:17:17+00:00

I am wondering wether it’s possible to use .htaccess to rewrite a folder name.

  • 0

I am wondering wether it’s possible to use .htaccess to rewrite a folder name.
What I mean is this.

Lets say I have a url like:

www.site.com/folder1/page.php

Now I want to rewrite the url to (for example)

www.site.com/apple/page.php

The folder1 is an existing folder on my webspace.

important: the “apple” is not a folder rather just a name!

Ok here is a step by step plan:

  1. User types www.site.com/folder1/login.php
  2. The url should rewrite and not redirect the url to www.site.com/apple/login.php

This means that apple is just a name and not a directory. All the code should just come from folder1. Acutally apple should just be an alias for folder1. I can’t just rename folder1 to Apple. Therefor I would just rewrite folder1 to apple.

  • 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-12T08:17:18+00:00Added an answer on May 12, 2026 at 8:17 am

    mod_rewrite can only rewrite/redirect requested URIs. So you would need to request /apple/… to get it rewritten to a corresponding /folder1/….

    Try this:

    RewriteEngine on
    RewriteRule ^apple/(.*) folder1/$1
    

    This rule will rewrite every request that starts with the URI path /apple/… internally to /folder1/….


    Edit    As you are actually looking for the other way round:

    RewriteCond %{THE_REQUEST} ^GET\ /folder1/
    RewriteRule ^folder1/(.*) /apple/$1 [L,R=301]
    

    This rule is designed to work together with the other rule above. Requests of /folder1/… will be redirected externally to /apple/… and requests of /apple/… will then be rewritten internally back to /folder1/….

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

Sidebar

Related Questions

I have come accross to this function below and I am wondering wether this
i was just wondering wether it is possible to add an uiimageview as a
I am wondering whether or not it is possible to output the class name
I was wondering wether it is possible to inject a frame script into a
Possible Duplicate: Java/C# method representation in memory I was wondering if i have an
I was wondering wether I can hide iAds once they are tapped. This way,
I'm wondering whether something like this is possible (and relatively easy to do), and
I was wondering wether it is possible to redirect someone to a different tab
I was wondering wether it was possible to know exactly where in the dom
i'm wondering whether it is possible to use ORDER BY clause (or any other

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.