Cielo
Cielo

Reputation:

mod_rewrite does not return $_GET-value?

I have a problem with mod-rewrite, to be more precise, it doesn't redirect me properly. Everything works fine on my local server, the problem only occurs when the site goes live... This is what I have in the .htaccess:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /

RewriteRule ^(tutorial|news|out|profile|script)/([0-9]+)/?$ $1.php?id=$2 [L]
RewriteRule ^(tutorial|news)/([0-9]+)/post-comment/?$ $1.php?id=$2&action=postcmt [L]

RewriteRule ^atelier/([0-9]+)/?$ img/gallery/view.php?id=$1 [L]
RewriteRule ^([a-zA-Z0-9]+)/page/([0-9]+)/?$ $1.php?page=$2 [L]
RewriteRule ^get/([a-zA-Z0-9]+)/([0-9]+)/?$ $1/get.php?id=$2 [L]
RewriteRule ^get/brushes/(abr|img)/([0-9]+)/?$ brushes/$1.php?id=$2 [L]

RewriteRule ^([a-zA-Z0-9]+)/(c|series|type)/([0-9]+)/page/([0-9]+)/?$ $1.php?$2=$3&page=$4 [L]
RewriteRule ^([a-zA-Z0-9]+)/(c|series|type)/([0-9]+)/?$ $1.php?$2=$3 [L]

RewriteRule ^design/preview/([0-9]+)/?$ design/preview.php?id=$1 [L]
RewriteRule ^([a-zA-Z0-9]+)/send/?$ $1.php?action=send [L]
RewriteRule ^askme/post-question/?$ ask.php?action=ask [L]

If I enter news/5/ for example, it will only redirect me to news.php, design/preview/5 will only take me to design/preview.php and so forth. On the contrary, get/brushes/abr/1 works fine... I have no idea what I'm doing wrong, any suggestions?

Upvotes: 1

Views: 552

Answers (2)

Gumbo
Gumbo

Reputation: 655239

MultiViews could cause this behavior. Try to disable it:

Options -MultiViews

Upvotes: 2

Fenton
Fenton

Reputation: 250922

Just to start from the simplest place and add complication after, does this work for you?

RewriteRule ^news/([^/\.]+)/?$ news.php?id=$1 [L,NC]

Upvotes: 0

Related Questions