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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:19:47+00:00 2026-06-04T14:19:47+00:00

I have been trying this for a little while nut just cannot get to

  • 0

I have been trying this for a little while nut just cannot get to work:

RewriteRule ^([^])/([^])\.php$ /$1.php [L,QSA]

I have a site:
http://www.mysite.com/dummyfolder/file.php

I want it to actually load:

http://www.mysite.com/file.php

FYI – dummyfolder is dynamic and thus changes.

The more complex part, is I would like to be able to ignore this on certain folders, for example be able to access: http://www.mysite.com/acutalfolder/file.php. Where acutalfolder exists and does not change its name.

Thanks so much – it has really been bogging me down and just cannot figure it out.

Ansari, thank you for answering and solving, however I need to correct my actual folder statement:

My actual folder is located here:

www.mysite.com/acutalfolder/file.php 

but I want to appear in the URL like this:

www.mysite.com/dummyfolder/acutalfolder/file.php 

if i use this (to try and ignore if I am using actualfolder):

RewriteRule ^([^/]+)(!^actualfolder$)/([^/]+)\.php$ /$2.php [L,QSA] 

It works fine going to the actualfolder address, but then the original rewrite pages no longer work. Any ideas where I am hitting this wrong?

UPDATE After help from Ansari. This now works beautifully with the following code:

RewriteCond %{REQUEST_URI} ^/([^/]+)/(actualfolder/.*\.php)$
RewriteCond %{DOCUMENT_ROOT}/%2 -f
RewriteRule .* %2 [L,QSA]


RewriteCond %{REQUEST_URI} ^/(?!actualfolder)([^/]+)/(.*\.php)$
RewriteCond %{DOCUMENT_ROOT}/%2 -f
RewriteRule .* %2 [L,QSA]

Many 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-06-04T14:19:48+00:00Added an answer on June 4, 2026 at 2:19 pm

    Try this:

    RewriteRule ^([^/]+)/([^/]+)\.php$ /$2.php [L,QSA]
    

    As for when actualfolder exists, you don’t need to do anything for that, unless you do some rewriting in another .htaccess file within actualfolder.

    EDIT after OP re-did the question:

    RewriteCond %{REQUEST_URI} ^/([^/]+)/(actualfolder/.*\.php)$
    RewriteCond %{DOCUMENT_ROOT}/%2 -f
    RewriteRule .* %2 [L,QSA]
    
    RewriteCond %{REQUEST_URI} ^/([^/]+)/(.*\.php)$
    RewriteCond %{DOCUMENT_ROOT}/%2 -f
    RewriteRule .* %2 [L,QSA]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying this for a while now and can't get it to
I have been trying to get this to work and I am nearly there
I have been trying to get this to work with several tutorials/answers here, but
I have been trying to figure this out for a little while now and
I’ve been trying to get this to work for a while but can’t (I
I have been trying to make this to be a little jQuery plugin that
I have been trying this for a good while now but I can't seem
I have been trying to get this android service working but I can not
I have been working on this for a little while, and I have also
I've been trying to do this for a little while and it's driving me

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.