You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Dan Brown <da...@zu.com> on 2007/11/26 01:20:46 UTC
[users@httpd] mod rewrite...
I don't deal with rewrite rules very often so I've got a bit of trouble
getting this going. I'm converting a number of sites over to PHP5 from
PHP4. A second instance of Apache with PHP4 is running on my server to
accommodate sites still not tested/converted to PHP5. This is part of an
htaccess file. The code between the two comments works fine on sites which
don't already use mod_rewrite but gives an internal server error on sites
with existing mod_rewrite rules like this.
RewriteEngine On
RewriteBase /
#S-PHP4 REDIRECT
RewriteCond %{SERVER_PORT} ^81$
RewriteRule ^(.*) /$1 [S=3]
RewriteCond /sites/WCW/www/htdocs/.php4 -f RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*) http://%{HTTP_HOST}:81/
#E-PHP4 REDIRECT
RewriteRule index.php.* - [L]
RewriteRule ^common.*$ - [L]
RewriteRule ^media.*$ - [L]
RewriteRule ^admin.*$ - [L]
RewriteRule ^(.*) /index.php/$1
These sites handle all URLs through index.php and rewrite the URL for the
browser.
All I seem to get is the error "RewriteRule: bad flag delimiter" no matter
what I try.
----
Dan Brown
danb@zu.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...
Posted by Krist van Besien <kr...@gmail.com>.
Hello Dan,
I'm seeing two problems,
On Nov 26, 2007 1:20 AM, Dan Brown <da...@zu.com> wrote:
> RewriteEngine On
> RewriteBase /
>
> #S-PHP4 REDIRECT
> RewriteCond %{SERVER_PORT} ^81$
> RewriteRule ^(.*) /$1 [S=3]
1) Are you sure you want to skip thhee rules here? You're skipping to
the "RewriteRule ^media.*$ - [L]" rule here.
> RewriteCond /sites/WCW/www/htdocs/.php4 -f RewriteCond %{SERVER_PORT} ^80$
2) the above rewritecond is malformed. Basically the error you get
("bad flag delimiter") points towards this.
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