Skip to content
View in the app

A better way to browse. Learn more.

GTAGames.nl - De Nederlandse Grand Theft Auto Community!

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[TUT] mod_rewrite

Om mod_rewrite te gebruiken moet je server dit ondersteunen kijk dit dus eerst na (je kan het altijd vragen aan de server administrator)

Als je server dit niet ondersteunt ben je hier dus niks mee :D

Wat is mod_rewrite?

Met mod_rewrite kan je je url herschrijven naar een veel ordelijkere url, handig als je een url hebt als index.php?bla=bla&dat=dat&wat=niks

Of zoals in mijn geval met de dynamische sig dat je een php extentie hebt en dat niet op een forum gelijk dit is toegelaten.

Je maakt een bestand met de naam: .htaccess

En met niks voor de "." want anders lukt het niet.

Dan zet je daarin:

RewriteEngine On

Om alles te beginen en dan zet je het volgende

RewriteRule ^url/(.*).html index.php?id=$1

Resultaat:

RewriteEngine On
RewriteRule ^url/(.*).html index.php?id=$1

het stukje tekst "url" is zonder http://www.domein.ext/.

De $1 word dus eigelijk vervangen door (.*) dus een voorbeeld zou dus zijn hier:

http://www.domein.ext/url/99.html

=

http://www.domein.ext/index.php?id=99

Ik denk dat je zelf wel weet wat het ordelijkste oogt + het is nog goed voor de SEO ook.

Edited by juuldr

Featured Replies

Mooie tutorial!

Ik begrijp het eindelijk. :puh:

Heel erg bedankt juul, ik vroeg me al tijden af hoe ze dat op phphulp.nl deden.

Vraagje, kan je op een windows pc ook een httacces hebben? Kan ik het ff uitproberen op mijn localhost namelijk.

  • Author

Ja, maar als je easyphp gebruikt moet je eerst iets confiureren in de apache configuratie.

Te bereiken via:

Klik op de E in het scherm (naast de knop apache) > configuratie > Apache

Daar varander je het volgende

#LoadModule rewrite_module modules/mod_rewrite.so

in

LoadModule rewrite_module modules/mod_rewrite.so

en

#AddModule mod_rewrite.c

in

AddModule mod_rewrite.c

Ja, maar als je easyphp gebruikt moet je eerst iets confiureren in de apache configuratie.

Te bereiken via:

Klik op de E in het scherm (naast de knop apache) > configuratie > Apache

[...]

Hoe weet jij dat ik easyphp gebruik? :clown:

Nee, heel erg bedankt. Het werkt nu. ;)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.