Clean URLS With Mod (ISAPI) Rewrite

4 posts by 2 authors in: Forums > CMS Builder
Last Post: October 2, 2009   (RSS)

After much trial and error we have achieved, what we think, are appropriate URL rewrites.

Notice this URL:
http://www.rentittoday.com/charter-jets-and-helicopters/Charter-Jet-Rentals-Stratos-Challenger-604-9?Charter-Jet-Rentals-Stratos-Challenger-604-9

And notice how it repeats the listing twice.
?Charter-Jet-Rentals-Stratos-Challenger-604-9

However the appropriate URL that we are trying to achieve in the end still works!

http://www.rentittoday.com/charter-jets-and-helicopters/Charter-Jet-Rentals-Stratos-Challenger-604-9

We're trying to figure out if it's appending the listing twice because of our htaccess code or something within CMS (such as viewer url, filename fields, or some other code)

The htaccess code for the above string is this:

RewriteBase /
RewriteCond %{QUERY_STRING} (.*)

RewriteRule ^viewers/air_plane_charter_jets_details\.php$ /charter-jets-and-helicopters/%1 [NC,R=301]

RewriteRule ^charter-jets-and-helicopters/([^/.]+)/?$ /viewers/air_plane_charter_jets_details.php?$1 [NC,L]

Jason Glass

Re: [rentittoday] Clean URLS With Mod (ISAPI) Rewrite

By Dave - October 1, 2009

Hi rentittoday,

If when you view-source on the page or mouse over the link it shows the url, then you know that is being generated by the program (or your viewer file).

But if it shows one url and only after clicking it sends you to another url, then you know it's mod_rewrite generating the second url.

I'm curious, what are you using to get mod_rewrite to work on your windows server?

Also, if you haven't already seen it there's some mod_rewrite tips and useful links here:
http://www.interactivetools.com/forum/gforum.cgi?post=74802#74802

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [rentittoday] Clean URLS With Mod (ISAPI) Rewrite

By Dave - October 2, 2009

Thanks for posting the links! That's very interesting.
Dave Edis - Senior Developer
interactivetools.com