Jump to content

Simple RewriteRule works on one production server, not on dev


Recommended Posts

mod_rewrite is for sure enabled on both servers, but the following script doesn't work on dev. Instead it rewrites to sitemap (no file extension), which results in a 404. Any idea what's up?

RewriteEngine On
RewriteBase /

RewriteRule ^sitemap\.xml$ sitemap.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

I just need to generate the sitemap via the sitemap.php script. What's weird is that I can't even call the script directly. Requests for sitemap.xml and sitemap.php are both routed to "sitemap".

I didn't try that (and don't know what it is without reading/searching), but the problem was that there was an .htaccess in a parent directory with a conflicting rewrite rule.

 

EDIT --

Thanks for your reply! I appreciate your time.

Edited by sKunKbad
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.