Jump to content

MOD_REWRITE and DirectoyIndex


pizzaboy

Recommended Posts

Hey guys,

 

I'm playing with the RewriteEngine in a .htaccess file buried away in a subdirectory on my site, and I'm experiencing some weird stuff that I don't know how to solve.

I get the idea of rewrite rules and how to use them. I also understand the idea of DirectoryIndex. My problem is that Apache seems to be ignoring my rules, and displaying any page that has the same filename as the name of the directory. I'm sure there's something in a httpd.conf somewhere but I'm new to Apache and I don't know what to look for. Having to rename some .php files so that the rewrite engine works seems stupid. How can I stop this effect and get Apache to just do whatever rules I write in the .htaccess file?

Link to comment
Share on other sites

Hey guys,

I'm playing with the RewriteEngine in a .htaccess file buried away in a subdirectory on my site, and I'm experiencing some weird stuff that I don't know how to solve.

I get the idea of rewrite rules and how to use them. I also understand the idea of DirectoryIndex. My problem is that Apache seems to be ignoring my rules, and displaying any page that has the same filename as the name of the directory. I'm sure there's something in a httpd.conf somewhere but I'm new to Apache and I don't know what to look for. Having to rename some .php files so that the rewrite engine works seems stupid. How can I stop this effect and get Apache to just do whatever rules I write in the .htaccess file?

I've myself faced many such issues, it needs inspection of 3-4 files (httpd.conf, .htaccess, php.ini sometimes, etc ).

What would ease this multiple-file-inspection situation a lot is to make a PHP CLI script to dump relevant parts of these files onto a command window / shell / terminal. If you make a browser-based script, you're asking people to destroy your site :)

GUI managers are great, those are a bit more tedious to write, IMO.

 

Keep in mind that we're soon going to shift en masse to PHP5 and next year, to PHP6

This kind of utility will help

 

Pros, cons, obvious flaws in this approach?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.