-2

I see many sites where they use something like this:

http://www.example.com/someinfo/somenumber

and then they use the 'somenumber' at the end to display content. I dont think they make a page for every number (since there are more than 1000 numbers, How do they do this?

Edit: They even do it on this site: if you look at the url the last bit (using-url-directories-in-php).

Fadey
  • 400
  • 1
  • 11

1 Answers1

1

Create a .htaccess file in your website's dir and paste the following code in it:

RewriteBase /
RewriteEngine On
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^([^\.]+)$ $1.html [NC,L]

There are many more things that htaccess could do for you, like blocking bad bots, ip block users (Not recommended on localhost server. You could try if you want.), redirect to a website, etc...

Jimmy
  • 76
  • 1
  • 9