Welcome to WebmasterWorld Guest from 54.205.209.95

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

help with mod rewrite

   
12:20 am on Jul 4, 2013 (gmt 0)



Hi

having real problems as my host just updated to most recent version of apache and my friendly urls stopped working

this is the URL that comes in from the search engines
http://www.example.com/product.php/23/myproduct

and this is the format the server needs it
http://www.example.com/product.php?xProd=23

I don't really know why this hass happened, and my hosting company is hopeless as to how to resolve it

what would the mod_rewrite code be to get this working again?

[edited by: bill at 1:12 am (utc) on Jul 4, 2013]
[edit reason] use example.com [/edit]

12:53 am on Jul 4, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Heh. There was a similar post quite recently and it also turned out to be a host-upgrade problem. Big name, so it may even be the same host. I'm envious. My host is HUGE and they don't seem to have upgraded yet.

Crystal ball says you've got a CMS that came with a prefabricated htaccess. It takes requests in one form and rewrites them to another form. Ordinarily the Apache version should have no effect, but there are some nasty exceptions involving exact format of paths. Or, then again, your host may have seized this opportunity to do some housekeeping, and physically rearranged everything on the server at the same time.

Before tearing out any more hair, check with the CMS itself and see if they've got an alternative htaccess for-- I assume-- Apache 2.4 instead of 2.2. And then you can post back and we'll tear the new version to pieces ;)

Just seen it prefers Example.com

Yes, often it's enough to follow the spirit of the law, but sometimes you have to follow the letter as well. A moderator will come along to fix it.
1:26 am on Jul 4, 2013 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, Robin_Javea!


stopped working


that's not much of a problem description to go on.

what response (status codes and Location: headers) do you get vs what you requested and what you were expecting?

what version of apache?

what does your current set of mod_rewrite rules look like?
(properly exemplified, of course)
1:37 am on Jul 4, 2013 (gmt 0)



Thanks lucy and phranque

I think we might be talking about the same host lucy, as all this has just happened following an upgrade from 2.2 to 2.4... for several years all was running okay with the friendly urls... the htccess up to that point didn't need to contain anything other than the php versions, so there was no mod_rewrites or additional coding needed.
3:39 am on Jul 4, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Does any of this sound familiar?

[webmasterworld.com...]
9:03 am on Jul 4, 2013 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



http://www.example.com/product.php/23/myproduct

Your "friendly" URLs aren't all that, uhh, friendly. You don't need "product.php" in the URL and the "fake" folder levels could be an issue.


http://www.example.com/pr23-myproduct

That's a more friendly URL!


this is the format the server needs it
http://www.example.com/product.php?xProd=23

You do realise that the product name part of the friendly URL request isn't being passed on? If the CMS is not checking that the requested product name is valid for this particular product number you have an infinite duplicate content problem. You also leave your site open to malicious
http://www.example.com/product.php/23/this-is-junk
linking.