Hi
I've got a bit of a problem with my url rewrites as I need to capture 3 chunks of the url string and turn them into get variables - however the 2nd and 3rd chunks may not exist in which case I need to still "capture" them as an empty value
This ONLY applies to urls with the string "action/" - all the others just have ".php" tagged on the end to get the right file
so, for example, I could have
http://mydoman.com/action/firstchunk
http://mydoman.com/action/firstchunk/secondchunk
http://mydoman.com/action/firstchunk?third=chunk&stillthird=chunk
http://mydoman.com/action/firstchunk/secondchunk?third=chunk
this then needs to be rewritten as
http://mydomain.com/task.php?t=firstchunk&v=secondchunk & the GET vars in the third chunk, if any
This is quite seriously doing my head in as I've got a rewrite that works fine without the original url query string GET vars but I just can't figure out how to add them on to the rewrite
can any help, please ??
here's my htaccess so far :
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
# redirect the url with www to url without
RewriteCond %{HTTP_HOST} ^www\.(([a-z0-9_]+\.)?mydomain\.(?:fr|co\.uk))$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule action/([^/]*)/?([^/]*)$ task\.php?t_id=$1&v_id=$2 [NC]
# add .php to urls
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [L]
ErrorDocument 404 /404.php