How'd I do this?

Associate
Joined
26 Jun 2003
Posts
1,140
Location
North West
Ive seen the subject around but dunno how to do it.

Basically I code my links on my site as ?p=whatever&id=number etc...

Egs:

/?p=news&id=2
/?p=interviews
/?p=interviews&id=1231

But how can I translate it to and still work the same way?

/news/2
/interviews
/interviews/1231

Is it modwrite or sumthing?

Thx
 
robmiller said:
Create a file called .htaccess in the same directory as your scripts. In it, put:

Code:
RewriteEngine On
RewriteBase /
RewriteRule ^news/([0-9]+)/?$			index.php?p=news&id=$1 [QSA]
RewriteRule ^interviews/([0-9]+)/?$		index.php?p=interviews&id=$1 [QSA]
RewriteRule ^interviews/?$			index.php?p=interviews [QSA]

Would I have to write the same thing for all my pages? (There will be about 15 different ?p=whatever and potentially LOADS of &id=number.
 
OK ive done what you said and I get this error:

Obviously I havnt setup a config or summit can sumone point me in the right direction? My site index is http://localhost/mysite/

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Thx
 
Last edited:
Back
Top Bottom