Re: [users@httpd] Mod-Rewrite within a Mod-Rewrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/8/06, David Blomstrom <david_blomstrom@xxxxxxxxx> wrote:
This is the rewrite rule for my Reference section, which works:



 RewriteRule ^Reference/([a-zA-Z0-9()_/-]+)/?$ Reference/index.php?ref=$1
[L]

 I'd like to also create a similar Glossary section, like this:




 RewriteRule ^Glossary/([a-zA-Z0-9()_/-]+)/?$ Glossary/index.php?glos=$1 [L]

 Except I'd like the URL to be MySite/Reference/Glossary. In other words,
the Glossary folder will be inside the Reference folder. So I created a new
page at Reference/Glossary/index.php, then changed my mod-rewrite rules, as
follows:




 RewriteRule ^Reference/Glossary/([a-zA-Z0-9()_/-]+)/?$
Reference/Glossary/index.php?glos=$1 [L]

RewriteRule ^Reference/([a-zA-Z0-9()_/-]+)/?$ Reference/index.php?ref=$1 [L]

 It now correctly displays URL's with text appended to Reference/Glossary,
like MySite/Reference/Glossary/politics. However, I can no
longer view the Glossary home page. If I type in MySite/Reference/Glossary,
it defaults to http://ivr/Reference/Glossary/?ref=Glossary,
and I get a custom Page Not Found error, where I used to get a real page.
How can I fix this?

you could ad a rule that does nothing but stop rule processing. For example:

RewriteRule ^(Reference/Glossary)$      $1   [L]

(add this rule before the others.)

This is how I usually do it when I need to get some URLs out of the
whole rewrite processing.

Krist

--
krist.vanbesien@xxxxxxxxx
Solothurn, Switzerland

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux