You are here: Re: Regular expression mod_rewrite (htaccess) « PHP Programming Language « IT news, forums, messages
Re: Regular expression mod_rewrite (htaccess)

Posted by Philip Ronan on 11/24/08 11:28

"Geradeaus" wrote:

> I use htaccess to rewrite the url using the following rules :
>
> RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)?$
> index.php?lang=$1&page=$2&id=$3
>
> The only problem I have is when http://www.domain.com/admin is given,
> the "admin" is used as $1. How can I define the rule for every word
> given except "admin" ?
>
> Thanks in advance!
>

Use a rewrite condition to exclude this case:
<http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html#RewriteCond>

Something like this perhaps:
RewriteCond %{REQUEST_URI} !^admin.*$
RewriteRule ...

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация