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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:08:42+00:00 2026-05-30T07:08:42+00:00

I have a url for ex : example.com/site/anyFolderName and i want to remap it

  • 0

I have a url for ex :

example.com/site/anyFolderName

and i want to remap it to:

example.com/site/myfolder/anyFolderName

but only go there if ‘anyFolderName’ folder exists.I’ve searched in a few places for this but can’t really figure it out.

Here’s what i found out so far :

Rewrite Condition to compare top level directory from Request_URI – very similar with what i need but i have 2 levels

http://httpd.apache.org/docs/2.2/rewrite/remapping.html #Search for pages in more than one directory

Thank you.

  • 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-30T07:08:43+00:00Added an answer on May 30, 2026 at 7:08 am

    Try adding the following to the .htaccess file in the root directory of your site.

    RewriteEngine on
    RewriteBase / 
    
    RewriteCond %{REQUEST_URI} ^/site/(\w+)$ [NC] 
    #if site/myfolder/anyFolderName exists
    RewriteCond %{DOCUMENT_ROOT}/site/myfolder/%1 -d
    #rewrite request to site/myfolder/anyfolder
    RewriteRule ^ site/myfolder/%1 [L,NC]     
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this URL example.com/photo?people I want to rewrite this URL in the form
I am trying to have a custom URL which looks like this: example.com/site/yahoo.com which
If I have a URL that is http://www.example.com/sites/dir/index.html , I would want to extract
I have issue with url rewrite. I have a site example.com that has a
I have a https site say with url www.example.com. On this server, I've an
We have an url like http://site.com/people/593765-barack-obama?sort=popular How do I get only the ID part
I have URL like: http://example.com#something , how do I remove #something , without causing
Let's say I have this url: www.example.com/test.php?page=4 How do i retrieve the value of
How can I hide the parameters in Codeigniter? I have this URL: http://example.com/profile/1 I
I have a url like www.example.com/mypage.php?id=324 That number 324 is auto incremented (meaning that

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.