RE: [users@httpd] Need a mod-rewrite rule for a website's home page

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

 



OK, I gave it another try, and it *seems* to be working. (I always qualify my statements, because I get so confused between PHP, MySQL and mod-rewrites, I'm not always sure if things are actually working or not.) But I can currently display rewritten dynamic links on both my home page and home-page/About, while typing in incorrect URL's produces an error page. So it looks like it's squared away. These are the rewrite rules I used:

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

Many thanks.

Boyle Owen <Owen.Boyle@xxxxxxx>
wrote:
> -----Original Message-----
> From: David Blomstrom [mailto:david_blomstrom@xxxxxxxxx]
>
> You mean literally reverse the order of the rewrite rules, like this?:
>
RewriteRule ^About/?(-[a-zA-Z0-9_/]+)/?$ About/index.php?bout=$1 [L]
RewriteRule ^/?([-a-zA-Z0-9_/]+)/?$ /index.php?home=$1 [L]

Yes.. Actually, are you sure the first rule works at all? I think you need "^/About..." (note leading slash).

Then anything beginning with About should be rewritten and then the [L] causes a break.

>
> I tried that, but it doesn't seem to work.

Does it or doesn't it? (there is no "seem" :-) What does the log say? What happens when you try test URLs (give examples of before and after)?


New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
[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