How to 30 Redirect - gallery.html?id=10view&detail

I’m having alot of trouble trying to redirect dynamic urls to static ones. I should say I use Joomgallery and sh404sef. For some reason joomgallery creates an additional url: gallery.html?id=10view$detail (with the id number obviously different for each image page) Now the sh404sef states that joomgallery urls starting with index.php? are the non sef urls, and these I have made SEF… Sh404sef has no account for the gallery.html? urls being generated by joomgallery so I have no choice but to redirect them to the SEF url otherwise search engines will think I have duplicate content e.t.c

I’ve tried everything I can think of for the .htaccess 301 redirect… I’ve read through lots and lots of forums and tried everything ‘experts’ had to offer but with no joy. So I’m hoping someone on here will have the answer.

So just to confirm… I am trying to 301 redirect gallery.html?id=10&view=detail to a SEF like this:

Any takers?


Have you bother to read the sticky threads in this forum board?

Obviously not! Okay, there is NOTHING in /stars that will allow Apache to get id’s value (10) or view’s value of detail. I cover that in my signature’s tutorial so please have a look and come back with questions … of an Apache nature. Joomgallery and sh404sef questions should be referred to their support desks or their forums.



Although I appreciate you for taking time out to reply… I don’t take too kindly to rudeness… I have read through all the ‘stickys’ and read through your tutorial but with no joy! So now I am just throwing it out there on the off chance that someone on here might have gone through a similar issue… I understand how to redirect dynamic urls that contain index.php? I just cannot find any help when it concerns html? with trailing parameters… for example… gallery.html?id=1002view&detail How would you go about redirecting a url like that, if it was you? What would be your process? I don’t even know what i should be looking for… How would I make apache get new domains id value? I have contacted joomgallery, but with no reply and contacted who are the creators of sh404sef but they told me to contact joomgallery… If I still cannot find an answer after sitepoint then I will have no choice but to pay a coder for the trouble…


Rudeness? Sorry you perceive it as such, it’s a matter of frustration with an open ended question and not looking for the answer here or elsewhere. At this point, not bothering to read the post above isn’t helping, either. I’m here to help members learn so … if you want to learn, I’m willing to help.

I answered your question stating that the information you’re after is in the tutorial and then explained that you are attempting to force Apache to guess what’s in your mind for the redirection. Computers are not clairvoyant so that just won’t happen.

Redirect dynamic URIs? Why? That’s what Apache can serve. Many “webmasters” don’t understand that mod_rewrite is used to redirect from a format which Apache can only provide a 404 response to something it can serve (200 response). If you STILL want to redirect away from gallery.html?id=1002view&detail (that doesn’t make much sense), where to you want to redirect it? Do you need to capture any of the QUERY STRING (hint) keys or values (only RewriteCond statements can do that)?

For my process, I mentally create a specification for the redirection I’ll be coding, i.e., how to specify the view and detail values in an unique manner (for Apache) then the redirection (index.php?view={something}&detail={something else}). As above, “there is NOTHING in /stars that will allow Apache to get id’s value (10) or view’s value of detail.”

Creating successful mod_rewrite code is a matter of planning, so, until you provide a useful specification (characters expected for view, characters expected for value, how to determine one from the other, any other “marker” to be able to identify that you want a redirection, etc.) of the redirection you’re seeking, I can’t provide any coding hints (I won’t code for “script kiddies” - they learn nothing) for you.




I’m not interested in learning… I am looking for an already made up code that will fix the problem. I create content, not code… Reason for 301 redirect is to prevent duplicate content… Apparently a 301 redirect is the best solution to fix this?

update After taking a deeper look into the issue, found out that if the id number does not exist the url string will be redirected back to gallery.html. However, if the id number does exist then it does not get redirected. Surely there must be a way to redirect the whole string back to gallery.html even if page id number exists or not.