Salut tous le monde
Voila, mon problème est que je n’arrive pas à faire de rewriting, je galère depuis des jours mais je n’arrive pas à un résultat. Pour que vous aurez une idée claire et pour q’on évite les intervention inutile voila ce que j’ai essayé :
« rewrite_module » est integré
« LoadModule rewrite_module modules/mod_rewrite.so » est décoché
Fichier httpd.conf :
Fichier .htaccess :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 <Directory /> Options FollowSymLinks AllowOverride All Order deny,allow Deny from all </Directory> # # Note that from this point forward you must specifically allow # particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it # below. # # # This should be changed to whatever you set DocumentRoot to. # <Directory "c:/wamp/www/"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride all # # Controls who can get stuff from this server. # # onlineoffline tag - don't remove Order Deny,Allow Deny from all Allow from 127.0.0.1 </Directory>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 Options +FollowSymlinks All -Indexes RewriteEngine on RewriteRule ^nexi.html$ index.html [L] ErrorDocument 404 /index.php
Quelques remarques sur le fichier .htaccess :
- fichier index.html existe
- fichier nexi.html n’existe pas
- fichier index.php n’existe pas
Ce que je veux c’est changer l’addresse « http://localhost/testing/ » ou « http://localhost/testing/index.html » en http://localhost/testing/nexi.html.
Le fichier .htaccess est à la racine de mon site c’est à dire dans la répertoire testing et il fonctionne correctement car j’ai remarqué par hasard que si je mets index.php dans ErrorDocument, lorsqu’il y a un erreur il me dirige vers la page d’acceuil du serveur ce qui est un peut étrange o_O mais si je change index.php par /testing/error.php ça fonctionne correctement mais le rewriting ne fonctionne pas toujours.
Fichier .htaccess:
Merci d'avance.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 Options +FollowSymlinks All -Indexes RewriteEngine on RewriteRule ^nexi.html$ index.html [L] ErrorDocument 404 /testing/error.php
Partager