Jump to content

Recommended Posts

Hello, I have a strange problem with mod rewrite, this rewrite rule shows 404 error:

 

RewriteRule ^admin(/)?$ admin.php

 

as long as the .php file is named the same. But if I rename existent file on server to something like admins.php and rewrite "admin/" to admins.php then it works ok.

It looks like I would not be able to rewrite "path/" if path.php exists

 

I am using a "grid" hosting account from Godaddy. These rules worked fine on some dedicated servers from where I got the site files.

Link to comment
https://forums.phpfreaks.com/topic/203240-cannot-rewrite-path-if-pathphp-exists/
Share on other sites

I think this is a problem with Apache Content Negotiation, but to be honest I've never ran into it myself so not sure how to fix it, perhaps disabling  mod_negotiation. Try checking the documentation at http://httpd.apache.org/docs/2.0/content-negotiation.html.

I also seen this... I have files as:

/image_files/120.jpg

and if I access same path without it's extension it still shows the file.

That happens with no rewrite rules from my end, I deleted the .htaccess to test this.

 

Let me know if this indicates any other issue, otherwise I am waiting for GoDaddy's answer and inform them about this other thing if needed. Looks like it is from their configuration, it is not a dedicated server so my access to settings is limited.

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.