homepage Welcome to WebmasterWorld Guest from 54.204.249.184
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
help with mod rewrite
Robin_Javea




msg:4590106
 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]

 

lucy24




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

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.

phranque




msg:4590133
 1:26 am on Jul 4, 2013 (gmt 0)

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)

Robin_Javea




msg:4590135
 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.

lucy24




msg:4590150
 3:39 am on Jul 4, 2013 (gmt 0)

Does any of this sound familiar?

[webmasterworld.com...]

g1smd




msg:4590196
 9:03 am on Jul 4, 2013 (gmt 0)

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.
Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved