You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by JimRaynor <db...@gmail.com> on 2008/11/03 14:09:15 UTC

[users@httpd] mod_rewrite behaving differently on different apache servers. What to do?

As part of SEO optimization, I use this code in my .htaccess file :


RewriteEngine On
RewriteRule ^some/(.*)/(.*).html$ some.php?&reqa=$1&reqb=$2

This code should rewrite this link: 

some/valuea/valueb.html 

into this: 

some.php?&reqa=valuea&reqb=valueb

I tried this on several apache servers. On some it works perfectly. On some
it doesn't work at all. And on some it rewrites first part of the link, but
not query string (part after ? ) . How to configure Apache for this to work?
Should I change something in Apache config file? Is there another piece of
code that does the same thing, but more consistently?

Thanks for reading this
-- 
View this message in context: http://www.nabble.com/mod_rewrite-behaving-differently-on-different-apache-servers.-What-to-do--tp20302459p20302459.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_rewrite behaving differently on different apache servers. What to do?

Posted by Krist van Besien <kr...@gmail.com>.
On Mon, Nov 3, 2008 at 2:09 PM, JimRaynor <db...@gmail.com> wrote:

> I tried this on several apache servers. On some it works perfectly. On some
> it doesn't work at all. And on some it rewrites first part of the link, but
> not query string (part after ? ) . How to configure Apache for this to work?
> Should I change something in Apache config file? Is there another piece of
> code that does the same thing, but more consistently?

As you seem to have the option of changing the apache config file you
could start by putting the rewrite rules there. Rewrite rules in
.htaccess files are tricky. You could then also add a RewriteLogFile
and increase RewriteLogLevel, as this will tell you what is going on.

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org