mardi 28 avril 2015

mod_rewrite issue with single file no query string

Trying to use mod-rewrite to alter the address bar versus the actual page that's being loaded. It works great when I have a query string to use, but I need to do it without a query string, just a straight up pretty url.

It seems to be that without a query string, straight mod_rewrites to files just shows the actual filename with extension.

Here's what my htaccess looks like:

Options +FollowSymLinks

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ $1/ [L,R=301]

This works:

RewriteRule ^admin/account/([^/]*)/$ /adminconfig/account.php?id=$1 [L]

This doesn't:

RewriteRule ^admin/account/$ /adminconfig/account.php [L]

What's happening is that in the address bar I see:

http://ift.tt/1AdITL5

should be:

http://ift.tt/1HPsdQn

Aucun commentaire:

Enregistrer un commentaire