Subsequent Edit: Never mined, I've think I got this.
"modrewrite"
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^test/(.*)$ test.php
</IfModule>
Example php usage
<br /><?php<br />$T=explode('/',$_SERVER["REQUEST_URI"],3);<br />$X=$T{2};<br />$Y = $X + 1;<br />echo'<a href="'.$Y.'">'.$Y.'</a>'<br />?><br />
the above was a crude way of doing it.
The below is what I needed.
RewriteRule ^([a-zA-Z0-9])/?$ test.php?board=$1&page=$2
RewriteRule ^([a-zA-Z0-9])/([0-9])/?$ test.php?board=$1&page=$2
RewriteRule ^([a-zA-Z0-9])/([0-1][0-5])/?$ test.php?board=$1&page=$2
RewriteRule ^([a-zA-Z0-9][a-zA-Z0-9])/?$ test.php?board=$1&page=$2
RewriteRule ^([a-zA-Z0-9][a-zA-Z0-9])/([0-9])/?$ test.php?board=$1&page=$2
RewriteRule ^([a-zA-Z0-9][a-zA-Z0-9])/([0-1][0-5])/?$ test.php?board=$1&page=$2
RewriteRule ^([a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9])/?$ test.php?board=$1&page=$2
RewriteRule ^([a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9])/([0-9])/?$ test.php?board=$1&page=$2
RewriteRule ^([a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9])/([0-1][0-5])/?$ test.php?board=$1&page=$2
RewriteRule ^([a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9])/?$ test.php?board=$1&page=$2
RewriteRule ^([a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9])/([0-9])/?$ test.php?board=$1&page=$2
RewriteRule ^([a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9])/([0-1][0-5])/?$ test.php?board=$1&page=$2
<html><br /> <head><br /> <title>mod_rewrite test</title><br /> </head><br /> <body><br /> <p><br /> The requested board is:<br /> <?php echo $_GET['board']; ?><br /> </p><br /><p><br /> The requested page is:<br /> <?php echo $_GET['page']; ?><br /></p><br /><?php $X=$_GET['page'];$Y = $X + 1;echo'<a href="'.$Y.'">'.$Y.'</a>' ?><br /> </body><br /></html>
Although, I am still having a problem figuring out a legitimate easy way to fix up the url in the users browser, lets say we were at "thisdomain.com" and we requested board "x", the url will look like "thisdomain.com/x".
How can I have the url be set as "thisdomain.com/x/", with the appended forward slash?
If you go to "boards.4chan.org/g" the url is set as "boards.4chan.org/g/", automatically appending the forward slash, the guy running that place sure used a whole boat load of mod rewrite tricks or something.
How would I go about adding that forward slash if its missing? I.e If you use the above example php and mod rewrite code and access the script w/o appending the slash mark and you click on the number link, the number is appended to the letter of the board requested, how do I stop that?
Edit: More specifically, I'm currently attempting to figure out how to append the trailing slash to the requested board, and if a board is requested along with the page number like so "domain.com/x/1/", give a 404, which shouldn't be to hard.
Edit #2: Obviously, I don't think mod rewrite is what I'm looking for in order to append the trailing slash on the client side, I guess I'll have to jumble up some php that echo's a meta refresh tag that fixes the url.
Edited by THAT1ANONYMOUSEDUDE, 25 September 2011 - 12:51 AM.