Reply to Re: Mod Rewrite

Your name:

Reply:


Posted by jimmy88@gmail.com on 09/19/05 18:43

Stefan Reiter wrote:
> I just realized - that is only my page variable -
> but what happens with the other variables I am using sometimes?
> www.url.com/index.php?page=folder1/subfolder2/subfolder3/&variable1=value1&variable2=value2
>
> u can't rewrite it to an url like
> www.url.com/index.php?page=folder1/subfolder2/subfolder3/?variable1=value1&variable2=value2
>
> Can you?
>
> Or should it be something like
>
> www.url.com/index.php?page=folder1/subfolder2/subfolder3/index.php?variable1=value1&variable2=value2
>
> Or how should it be done the best way possible for search engines?
>
> Cheers,
>
> Stefan
>
> ZeldorBlat schrieb:
> > In the case you've described, your rewrite-rule would look something
> > like this (not tested):
> >
> > RewriteRule ^/(*)$ /index.php?page=$1
> >
> > In other words, in the original URL match everything after the / and
> > call it $1. Then in your re-written URL you just use the $1 to
> > represent the pattern that was matched.
> >

heres what i use
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]

It checks if the url is a dir or a file & then it rewrites it with the
extra querystring.
good luck

[Back to original 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

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