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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:38:59+00:00 2026-05-31T21:38:59+00:00

this is my mod_rewrite rule: RewriteEngine On RewriteRule ^([^./]+)/?$ index.php?id=$1 [L] That will rewrite

  • 0

this is my mod_rewrite rule:

RewriteEngine On
RewriteRule ^([^./]+)/?$ index.php?id=$1 [L]

That will rewrite http://www.mysite.com/abc/ to http://www.mysite.com/index.php?id=abc. However, I also have a sub directory in there that I don’t want it to be rewrite. So if a directory exist, it should just use the directory. If not it will use the rewrite. How can this be done?

  • 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-31T21:39:00+00:00Added an answer on May 31, 2026 at 9:39 pm

    Easy as pie:

    RewriteEngine On
    # Make sure it's not a real directory
    RewriteCond %{REQUEST_FILENAME} !-d
    # Make sure it's not a real file
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteRule ^([^./]+)/?$ index.php?id=$1 [L]
    

    Hey by the way it took me 2s to find the answer: 2s = the time to type “rewriterule file does not exist”

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

Sidebar

Related Questions

I have the following .htaccess rule: RewriteEngine on RewriteRule ^(.*) http://www.server2.com/index.php?action=$1 I need to
I have this rule: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !index.php RewriteRule ^(.*)$ index.php?req=$1
Is it possible to re-write (Apache Mod-Rewrite) a URL from this: http://www.example.com/view.php?t=h5k6 to this
Im trying to rewrite www.mysite.com/admin/index.php?page=pagename to www.mysite.com/admin/pagename In my .htaccess file (located in www.mysite.com/admin)
I would like to use mod_rewrite to transform a URL like this one: http://example.com/qxs/app/myapp.qxs
Can anyone explain what this mod_rewrite rule is doing? I'm trying to comment the
I noticed, that sometimes (especially where mod_rewrite is not available) this path scheme is
I have made a mod_rewrite condition that will just add a parameter to the
I have a website xxxxx.com and the URL structure to dynamic content is xxxxx.com/tours/index.php?tourid=x
I have the following .htaccess at present. <IfModule mod_suphp.c> suPHP_ConfigPath /home/abc/php.ini </IfModule> RewriteEngine on

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.