views:

8

answers:

2

How to make this work?:

somesite.com/page/2 -> somescript.php?page=2

A: 

Ehrm, that's a tricky one. Do both run on the same server? Because otherwise somesite.com will have to do some kind of redirect (or you have to proxy stuff internally).

If it were on the same virtual host it would look something like this:

RewriteRule ^page/(\d+)$ /somescript.php?page=$1

STATUS_ACCESS_DENIED
A: 

Edit: Hm, maybe i misunderstood your question. Do you want "regular" url rewrites, or are you trying to rewrite urls from one server to a script on another?

For regular rewrites, this should do it:

In your .htaccess:

RewriteEngine on
RewriteRule ^page/([0-9]+)$ somescript.php?page=$1

This will match all urls starting with page/ following by any number of digits. Theese digits will be available in somescript.php as $_GET['page'].

alexn