|
|
|
|
||||||
| alt.apache.configuration Apache web server configuration issues. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello,
I have a problem with MultiViews and rewriting, after a change in the file naming scheme I would like to enforce a certain clean URL form without filename extensions in the form of /foo, /bar or /bar.en or /bar.de instead of foo.html, bar.en.html, bar.de.html. To be precise I want the following external redirects: foo.html -> /foo bar.html -> /bar (and then content negotiation should determine if the de or en variant is delivered) For bar.html this can be solved by RewriteCond %{REQUEST_FILENAME} !\.(de|en)\.html$ RewriteRule ^(.+)\.html$ /$1 [R=301,L] However this creates an infinite redirect loop for foo.html, it matches the RewriteCond, is turned from foo.html into /foo, then Multiviews makes that foo.html again and the rewrite starts all over infinitely. How can I stop that? I cannot just turn off MultiViews since I need it for /bar. Thanks for any . Regards, Johann |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
iN ARTICLE <1160518963.572660.204740@i42g2000cwa.googlegroups .com>,
"Johann Gile" <jgile_linux@yahoo.de> writes: > Hello, > > I have a problem with MultiViews and rewriting, after a change in the > file naming scheme I would like to enforce a certain clean URL form > without filename extensions in the form of /foo, /bar or /bar.en or > /bar.de instead of foo.html, bar.en.html, bar.de.html. To be precise I > want the following external redirects: > > foo.html -> /foo > bar.html -> /bar (and then content negotiation should determine if the > de or en variant is delivered) Forget mod_rewrite. mod_negotiation will select the right variant for you, regardless of whether the ".html" appears in the URLs. See the documentation, and also the (multilingual) Apache manual itself. -- Nick Kew Application Development with Apache - the Apache Modules Book http://www.prenhallprofessional.com/title/0132409674 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Nick Kew schrieb:
> iN ARTICLE <1160518963.572660.204740@i42g2000cwa.googlegroups .com>, > "Johann Gile" <jgile_linux@yahoo.de> writes: > > /bar.de instead of foo.html, bar.en.html, bar.de.html. To be precise I > > want the following external redirects: > > > > foo.html -> /foo > > bar.html -> /bar (and then content negotiation should determine if the > > de or en variant is delivered) > > Forget mod_rewrite. mod_negotiation will select the right variant for > you, regardless of whether the ".html" appears in the URLs. well, this already works and is not the issue. However I want URLs with a ".html" to be redirected with a 301 code as shown above. I just can't get it to work without an infinite redirect loop beacuse of MultiViews. |
|
![]() |
| Outils de la discussion | |
|
|