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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:10:44+00:00 2026-05-28T11:10:44+00:00

How can Apache be rewriting URLs without mod_rewrite enabled or configured? I’m working on

  • 0

How can Apache be rewriting URLs without mod_rewrite enabled or configured?

I’m working on a site redesign from my development server. I was using a directory structure for site sections, but I am considering switching to URL rewriting and putting related files in the site’s root.

For example, the about page has a subdirectory named about that contains an index.php which is served when the request is http://www.example.com/about. I plan to change this so that about.php from the site’s root directory is served even if the request doesn’t include the php extension.

On my development server, the problem is that the URLs are already being rewritten even though I don’t have an .htaccess file anywhere along the path hierarchy.

The Apache configuration is the stock Ubuntu configuration and I suspect that it’s something unique to Ubuntu, but I can’t find the cause.

Here are some observations I’ve made:

  • /etc/apache2/httpd.conf is empty, but the configuration is in /etc/apache2/apache2.conf which in turn Includes config files from a few other directories.
  • There were no .htaccess files anywhere in the hierarchy of this site. I’ve checked every directory starting at /var/www
  • No .conf or .load files under /etc/apache2 have any reference to rewrite other than the rewrite.load file in /etc/apache2/mods-available.
  • I’ve set the LogWarning directive to debug. When I access a page without the .php extension, the error log shows the URL with the extension and the access log shows it without the extension and a HTTP 200 status. The page is served properly.
  • If I do add a .htaccess file with the appropriate configuration, I get an .htaccess: Invalid command 'RewriteEngine' error. … mod_rewrite wasn’t even loaded by default.
  • If I enable mod_rewrite by linking to the load file in /etc/apache2/mods-enabled it works as expected, which is to say exactly the same as if I didn’t enable it.

access.log shows:

127.0.0.1 - - [16/Jan/2012:05:36:35 +0800] "GET /dev/ghodmode.com/h5bp/ HTTP/1.1" 200 3602 "http://alienware/dev/ghodmode.com/h5bp/experiments" "Mozilla/5.0 (Ubuntu; X11; Linux x86_64; rv:8.0) Gecko/20100101 Firefox/8.0"

while error.log shows:

[Mon Jan 16 05:23:23 2012] [debug] mod_deflate.c(615): [client 127.0.0.1] Zlib: Compressed 5347 to 1876 : URL /dev/ghodmode.com/h5bp/experiments.php, referer: http://alienware/dev/ghodmode.com/h5bp/

If I add an .htaccess file:

[Mon Jan 16 05:34:33 2012] [alert] [client 127.0.0.1] /var/www/dev/ghodmode.com/h5bp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer: http://alienware/dev/ghodmode.com/h5bp/experiments

Update

Thanks to answers provided, I’ve been reading and I’ve learned a few things. The gist of it is that I’m using a stock Ubuntu installation of Apache2 and I haven’t changed any configuration settings from the default. So, none of the suggested causes are set.

Of course there is the chance that I’ve misunderstood some of the documentation. This is the first time I’ve read about some of these options.

Multiviews
Multiviews provides the best explanation of this scenario, but that requires a type map or MultiViews option set for a path. I only have one type map (/etc/apache2/mods-enabled/mime.conf) for ‘var’ and the MultiViews option is only set for /usr/share/apache2/icons. So, this couldn’t be it.

Redirect & RedirectMatch
Redirect & RedirectMatch would provide a good explanation for this behavior, but it requires a directive for each redirection. I don’t have any of these set and any path that I type serves the related php file if it exists. Also, if this was the cause, I think that the access.log would generate a 3xx status instead of 200 if it was a redirect.

Alias & AliasMatch
Alias & AliasMatch, like Redirect & RedirectMatch, requires a directive to be set for each resource. I only have an alias set for /icons/.

FallbackResource
FallbackResource identifies a single resource to serve when the requested resource isn’t present. In my case, when the requested resource isn’t present it serves the resource found by appending ‘.php’ to the end of the request. I also double-checked and there are no FallbackResource directives set.

Here’s an example of the command I use to confirm that there a particular option isn’t set anywhere:

find /etc/apache2 -name "*.conf" -exec grep -li "FallbackResource" {} \;

Update #2:

There was a hole in my search for the MultiViews option. I was only looking for files with a .conf or .load extension, but some of the configuration files don’t have an extension at all. The MultiViews option is set by the default site configuration file /etc/apache2/sites-enabled/000-default.

Thanks to @zneak for providing the answer first, although he did it in a comment. And thanks to @regilero who indirectly showed me what I was missing by using a different syntax for grep from the syntax I’m used to.

  • 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-28T11:10:45+00:00Added an answer on May 28, 2026 at 11:10 am

    What you call a rewrite can be done by a lot of others instructions:

    • Redirect & RedirectMatch : for external redirection (with 301,302 or even 403 or 404 codes
    • Alias & AliasMatch : for internal redirection (internal directory re-mapping for example)
    • FallBackresource : to redirect every missing file to an index.php boostrap
    • Option Multiviews : from mod-autoindex which is enabled by default on a lot of installations

    Theses configuration things are usually not in .htaccess files by default, as .htaccess files is just a bad thing slowing down apache and allowing user to add some other rules than the one defined in VirtualHosts. Most usefull configuration stuff is in /etc/apache2/sites-enabled, /etc/apaches2/mod-enableds/ and /etc/apache2/conf.d/.

    Now the strangest one is Option Multiviews make a grep -R MultiViews /etc/apache2/*. This option will map any call to http://www.example.com/foo/bar to foo/bar.php or foo/bar.html if theses directories exists in the DocumentRoot and if theses files exists (trying on all available extensions).

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

Sidebar

Related Questions

Can a Silverlight 2 enabled web page be managed from an Apache server? (I'm
I am used to working with Apache servers, so when mod_rewrite is enabled, I
Can the Apache Server be configured to use other protocols and not just HTTP/HTTPS
Apache XMLBeans can be used to generate Java classes and interfaces from XML Schema
Apache Pig can load data from Hadoop sequence files using the PiggyBank SequenceFileLoader :
How can I integrate URL rewriting in my Glassfish v3 server? The reason why
I have configured my apache 2.2 server as a simple forward proxy using mod_proxy
My server is having unusually high CPU usage, and I can see Apache is
I apologize before hand if this is an obvious question: can Apache 2.0 +
How can I rotate the Apache Access and Error logs on a Window 2000

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.