Closed Thread Icon

Topic awaiting preservation: rewrite engine (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=25359" title="Pages that link to Topic awaiting preservation: rewrite engine (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: rewrite engine <span class="small">(Page 1 of 1)</span>\

 
EDDII
Bipolar (III) Inmate

From:
Insane since: May 2004

posted posted 03-29-2005 17:22

ok iv been working ages on this ang i still have gotten nowhere
im trying to make my urls nicer whilst at the same time making my pages search engine freindly.
i have, in my .htaccess file

RewriteEngine on
RewriteRule /page/(.*) /page.php?id=\%3d$1 [R,NE]

and i obviosly have a page called page.php and i have been told that this will make it so that if someone looks for page/13 or page/13/ it will show them page.php?id=13 but it returns the error message that "the url could not be found on this server"
bless my stupidity

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 03-29-2005 18:10

i have and still am fighting with this. see here: Stupid mod_rewrite.......

Later,

C:\

EDDII
Bipolar (III) Inmate

From:
Insane since: May 2004

posted posted 03-30-2005 02:04

hey another quicky but its on URIs but i do $REQUEST_URI, $HTTP_SERVER_VARS["REQUEST_URI"] or $_SERVER['PHP_SELF'] it returns the new adress instead of the adress in the adress bar
in other words if you go to 'tester/14/' on my site it will show u 'tester/index.php?id=14' but keep 'tester/14/ showing in the taskbar and i would like to be able to request the url
i am using rewrite engine by the way

Emperor
Maniac (V) Inmate

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 03-30-2005 21:36

Whats this do?

quote:
\%3d



I'd suggest renaming your page.php to avoid looping and do this:

code:
RewriteEngine on
RewriteRule page/([0-9]+) /fetch_page.php?id=$1 [L]



-------------------
I'm unsure of your second question.

There is a trick to this - I have soem notes I can't find but lets see if I get this right. Without the [R] command (which will redirect to the URL and you won't encounter this problem as far as I've found):

PHP_SELF - will return the underlying URL - in your case: page.php?id=34
REQUEST_URI - will return the cleaner "masking" URL - in your case: /page/34/

That way you can access both parts (if you need to). It can be handy if you are creating pseudo directories but you actually have a central script dealing with some of this stuff so:

/links/34/ -> index.php?links=34
/faq/34/ -> index.php?faq=34

but you do other things elsewhere:

/forum/34 -> /forum/index.php?thread=34
/files/donkey/ -> /files/donkey.php

etc.

You can then set up a centralised/global script to spot the folder structure and do something accoridngly on a sitewide basis. But again you may not need it - I have though

___________________
Emps

The Emperor dot org | Justice for Pat Richard | FAQs: Emperor | Site Reviews | Reception Room

if I went 'round saying I was an Emperor just because some moistened bint had lobbed a scimitar at me, they'd put me away!

(Edited by Emperor on 03-30-2005 21:36)

(Edited by Emperor on 03-30-2005 21:37)

EDDII
Bipolar (III) Inmate

From:
Insane since: May 2004

posted posted 03-31-2005 01:47

check it out http://ddm.bloodonthecanvas.com/tester/view/09/ they return pretty much the same but written differently, see if it helps you to understand the problem a little better
as for your looping effects i found that using the same page name sometimes gave me them anyway like if i wen i put in 'somthing/view/' to go to 'somthing/view.php' but dont worry about that please, just the top problem and then go back to your short insignificant lives

Emperor
Maniac (V) Inmate

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 03-31-2005 03:07

EDDII: I'm not sure what I'm supposed to be looking at. A broken page isn't overly useful.

Have you tried something along the lines that I give?

Can I see the mod_rewrite statements as they are being run live?

___________________
Emps

The Emperor dot org | Justice for Pat Richard | FAQs: Emperor | Site Reviews | Reception Room

if I went 'round saying I was an Emperor just because some moistened bint had lobbed a scimitar at me, they'd put me away!

EDDII
Bipolar (III) Inmate

From:
Insane since: May 2004

posted posted 04-01-2005 13:16

wheres the embarresed smiley in here?
deleted it what a fool i am
i just put a page up that showed that $REQUEST_URI, $HTTP_SERVER_VARS["REQUEST_URI"] and $_SERVER['PHP_SELF'] all returned the actual page adress 'page.php?view=09' rather than 'view/09/ ' like you said

« BackwardsOnwards »

Show Forum Drop Down Menu