mod_rewrite d'Apache


Simcamb

Recommended Posts

J'ai découvert hier soir le mod_rewrite de Apache que je ne connaissais pas du tout. C'est une fonction particulierement pratique, mais j'ai deux petits problemes :

1 - Comment faire pour que l'url reste "cachée" ?

Exemple : http://www.simcamb.be/log-128.html'>http://www.simcamb.be/log-128.html ça c'est l'url "fake", qui redirige vers http://www.simcamb.be/?file=logs&id=128'>http://www.simcamb.be/?file=logs&id=128 . Le probleme c'est qu'on voit quand meme cette derniere, et que je voudrais que le lien en html reste dans la barre d'adresses

2 - Je n'arrive pas a faire valider les adresses du type http://www.simcamb.be/log/128,'>http://www.simcamb.be/log/128, il m'envoie en 404 :/

Voilà le contenu de mon .htaccess

[fixed]ErrorDocument 404 http://www.simcamb.be

Options +FollowSymlinks

RewriteEngine on

RewriteRule ^log-([0-9]+)\.html$ http://www.simcamb.be?file=logs&id=$1 [NC,L]

RewriteRule ^logs/([0-9]+)$ http://www.simcamb.be?file=logs&id=$1 [NC,L][/fixed]

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...