Create an account


A sudden coding question.

#1
Question 
I have a question to site coder(s). How did you make every page to assign to it's number?

I have tried both ways to do something like that on my local site and I had this pictures on a quit:
1. Every page with it's flash (for example) file locates in it's own folder like 7324, but it was originally a failed structure after I saw I can enter any number in your site's address and there will be a z0r.de page anyway.
2. When writing this, I just thought I can create a page like 312.html in a root and use it in a navigation. But I ain't sure.

I also saw I can print xxxx or 12xxxxxx on your site and it works the same way.

As a noob in php coding I wonder how did you do that.
Can you give me an advice, please?

- respectfully. john.
Reply

#2
I forward the number via htaccess to a php script.
For example http://z0r.de/4 forwards to http://z0r.de/index.php?id=4
The php script then displays the respective animation.
Reply

#3
So you use a rewrite module for that?
Reply

#4
jup

Code:
RewriteEngine on
RewriteRule ^([0-9]+)$ index.php?id=$1
This will forward only numbers so subfolders that begin with letters still work
Reply

#5
Huge thanks. Didn't think it is that easy.
Reply




Forum software by © MyBB Theme © iAndrew 2016