Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mod Rewrite

0 views
Skip to first unread message

Stefan Reiter

unread,
Sep 18, 2005, 9:15:26 AM9/18/05
to
Hi,

I got a totally dynamic website, and to improve my search engine
results, I would like to use mod rewrite.

From what I've understood so far, I have to put the necesarry lines
into my htacess file, right?

Anyway, I read some tutorials, but I can't quite grasp how to
do it in my case -

I have an url like that:
www.url.com/index.php?page=folder1/subfolder2/subfolder3/
and I want it rewritten to:
www.url.com/folder1/subfolder2/subfolder3/

How can I get this done?

Thanks,


Stefan

ZeldorBlat

unread,
Sep 18, 2005, 10:00:50 AM9/18/05
to
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.

Stefan Reiter

unread,
Sep 18, 2005, 10:40:49 AM9/18/05
to
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:

Jerry Stuckle

unread,
Sep 18, 2005, 12:42:06 PM9/18/05
to
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

And your PHP question is?????

P.S. Please don't top post.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================

jim...@gmail.com

unread,
Sep 19, 2005, 11:43:28 AM9/19/05
to

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

0 new messages