I have the following modrewrite...
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)/$ ?name=$1 [nc]
I want to a few more parameters, such as:
RewriteRule ^(.*)/(.*)/(.*)/(.*)$ ?name=$1&ab=$2&cd=$3&ef=$4 [nc]
This doesn't seem to be working though. If I only have one parameter populated, then it doesn't work - 404.
Any ideas? There won't always be 4 values, but there will always be the first one.
ModRewrite
Moderator: General Moderators
Re: ModRewrite
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)$ ?name=$1&ab=$2&cd=$3&ef=$4
Re: ModRewrite
Hmm.. I get the same problem, if I only use the first value (i.e., http://www.domain.com/something/) it returns 404
Re: ModRewrite
This works...
RewriteRule ^([^/]+)(?:/([^/]+)(?:/([^/]+)(?:/([^/]+))?)?)?/?$ /?name=$1&ab=$2&cd=$3&ef=$4 [QSA,L]
RewriteRule ^([^/]+)(?:/([^/]+)(?:/([^/]+)(?:/([^/]+))?)?)?/?$ /?name=$1&ab=$2&cd=$3&ef=$4 [QSA,L]