htaccess rewriterule with order in url
Posted
by
NRoscoe
on Stack Overflow
See other posts from Stack Overflow
or by NRoscoe
Published on 2014-05-31T21:22:46Z
Indexed on
2014/05/31
21:25 UTC
Read the original article
Hit count: 254
I'm trying to put together a rewrite rule for an Apache server. It should take 'order/###' and change it to 'order.php?id=###'. For some reason it's rewriting as 'order.php/###'. If I change it to anything other than 'order' my rule works fine.
Anyone know what's going on?
My .htaccess file looks like this:
RewriteEngine on
## tighten host
RewriteCond %{HTTP_HOST} !^mydomain\.com$ [NC]
RewriteRule .? http://mydomain.com%{REQUEST_URI} [R=301,L]
## Dynamic Pages
RewriteRule ^order/([0-9]+)/?$ order.php?code=$1 [L,NC]
## Static Page Redirects
RewriteRule ^prices$ /prices.php [L,NC]
RewriteRule ^examples$ /examples.php [L,NC]
I have no access to the httpd main server config file on the live server.
© Stack Overflow or respective owner