473,473 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Mod Rewrite

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:
http://www.url.com/index.php?page=fo...r2/subfolder3/
and I want it rewritten to:
www.url.com/folder1/subfolder2/subfolder3/

How can I get this done?

Thanks,
Stefan
Sep 18 '05 #1
4 1752
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.

Sep 18 '05 #2
I just realized - that is only my page variable -
but what happens with the other variables I am using sometimes?
http://www.url.com/index.php?page=fo...riable2=value2

u can't rewrite it to an url like
http://www.url.com/index.php?page=fo...riable2=value2

Can you?

Or should it be something like

http://www.url.com/index.php?page=fo...riable2=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.

Sep 18 '05 #3
Stefan Reiter wrote:
I just realized - that is only my page variable -
but what happens with the other variables I am using sometimes?
http://www.url.com/index.php?page=fo...riable2=value2
u can't rewrite it to an url like
http://www.url.com/index.php?page=fo...riable2=value2
Can you?

Or should it be something like

http://www.url.com/index.php?page=fo...riable2=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.
js*******@attglobal.net
==================
Sep 18 '05 #4

Stefan Reiter wrote:
I just realized - that is only my page variable -
but what happens with the other variables I am using sometimes?
http://www.url.com/index.php?page=fo...riable2=value2

u can't rewrite it to an url like
http://www.url.com/index.php?page=fo...riable2=value2

Can you?

Or should it be something like

http://www.url.com/index.php?page=fo...riable2=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

Sep 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Link | last post by:
Hello!I am new to Python and I would like to rewrite the following code to python use to call by C program:// JPython code ======================================= import...
1
by: darrel | last post by:
We're using URL rewriting (Isapi Rewrite). Is there any way to grab the pre-rewritten URL or can you only grab the rewritten one? I'm assuming you can't (as that's sort of the point of URL...
2
by: VM | last post by:
I'm about to work on a 'buggy' WIndows C GUI application that was entirely made in C. All the user controls were all hard-coded and the code is pretty hard to understand. The application was made...
1
by: baroque Chou | last post by:
Thanks for the help available on msdn, I have succesful done the rewrite job. But there are 2 problems arise: 1.when I try to rewrite the url from say: www.yoursite.com/beverages.aspx to...
14
by: Stan Canepa | last post by:
This post is mostly for discussion. Why rewrite in .NET? Just a general discussion not related to any specific details. I was just looking to see what reasons developers are looking to, to help...
18
chunk1978
by: chunk1978 | last post by:
hi everyone. i just started learning how to dynamically show/hide elements with a checkbox toggle. i would like to know if it's possible to delete/rewrite elements instead of simply show/hide...
1
by: polilop | last post by:
Is there a URL rewrite module that allows to rewrite url by looking at the database. Egxample: http://www.somesite.com/object.aspx?objectCountryId=1&objectId=22 now i look into the database, see...
1
by: mazdotnet | last post by:
Hi all, I've installed the new Microsoft URL Rewrite Module for IIS 7.0 http://www.iis.net/downloads/default.aspx?tabid=34&i=1691&g=6 on both my laptop (Vista Home Premium) and my desktop...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.