Activer l'url rewriting

Activer l'url rewriting - PHP - Programmation

Marsh Posté le 08-03-2005 à 19:31:58    

Bonjour,
 
Je souhaite activer l'url rewriting dans Apache v2.0.53.
 
J'ai donc décommenté la ligne LoadModule rewrite_module modules/mod_rewrite.so. Puis j'ai redémarré Apache.
 
Malheureusement j'obtiens des pages d'erreur 404 lorsque j'utilise les url en html.
 
Aurais-je oublié un autre paramètre ?
 
Petite précision : avant j'étais sur un serveur mutualisé, avec le même fichier htaccess, et exactement les mêmes redirections, et cela fonctionnait.
 
Donc le problème vient, je pense de httpd ...
 
Merci d'avance pour votre aide.


---------------
Otau Games : simulation automobile, jeu de voiture, jeu de course : tout pour votre bonheur !
Reply

Marsh Posté le 08-03-2005 à 19:31:58   

Reply

Marsh Posté le 08-03-2005 à 19:32:58    

et il y a quoi dans ton .htaccess ?


---------------
Nos estans firs di nosse pitite patreye...
Reply

Marsh Posté le 08-03-2005 à 19:39:06    

Bon, j'ai réussi à régler le problème ... Erreur d'étourderie, j'avais oublié de dire à Apache de lire htaccess.
 
Pour le htaccess, le voila si ça t'interesse toujours :
 

Code :
  1. DirectoryIndex index.php index.cgi index.pl index.shtml index.html
  2. RewriteEngine On
  3. RewriteRule ^index.html index.php
  4. RewriteRule ^gate.* modules.php
  5. #Articles
  6. RewriteRule ^article([1-9][0-9]*).* gate.html?name=News&file=article&sid=$1
  7. RewriteRule ^topic([1-9][0-9]*).* gate.html?name=News&new_topic=$1
  8. RewriteRule ^cat([1-9][0-9]*).* gate.html?name=News&file=categories&op=newindex&catid=$1
  9. RewriteRule ^cat([1-9][0-9]*).* gate.html?name=News&file=article&op=newindex&catid=$1
  10. RewriteRule ^printout([1-9][0-9]*).* gate.html?name=News&file=print&sid=$1
  11. RewriteRule ^articles.* gate.html?name=News&file=index
  12. #Content
  13. RewriteRule ^contentid-([1-9][0-9]*).html gate.html?name=Content&pa=showpage&pid=$1
  14. RewriteRule ^content-cat-([1-9][0-9]*).html gate.html?name=Content&pa=list_pages_categories&cid=$1
  15. #Downloads
  16. RewriteRule ^topdowns.html gate.html?name=Downloads&d_op=TopRated
  17. RewriteRule ^topdowns-(10|25|50)-(num|percent).html topdowns.html&ratenum=$1&ratetype=$2
  18. RewriteRule ^popdowns.html gate.html?name=Downloads&d_op=MostPopular
  19. RewriteRule ^popdowns-(10|25|50)-(num|percent).html popdowns.html&ratenum=$1&ratetype=$2
  20. RewriteRule ^newdowns.html gate.html?name=Downloads&d_op=NewDownloads
  21. RewriteRule ^newdownsw-([0-9]*).html gate.html?name=Downloads&d_op=NewDownloads&newdownloadshowdays=$1
  22. RewriteRule ^newdownsd-([0-9]*).html gate.html?name=Downloads&d_op=NewDownloadsDate&selectdate=$1
  23. RewriteRule ^downcat([0-9]*).html gate.html?name=Downloads&d_op=viewdownload&cid=$1
  24. RewriteRule ^downorder([0-9]*)-([a-zA-Z0-9]*).html gate.html?name=Downloads&d_op=viedownload&cid=$1&orderby=$2
  25. RewriteRule ^downfile([0-9]*) gate.html?name=Downloads&d_op=getit&lid=$1
  26. RewriteRule ^downcat([0-9]*).html&orderby=([a-zA-Z_]*) gate.html?name=Downloads&d_op=viewdownload&cid=$1&orderby=$2
  27. RewriteRule ^downcat([0-9]*)-([0-9]*)-([a-zA-Z0-9]*)-([0-9]*).html gate.html?name=Downloads&d_op=viewdownload&cid=$1&min=$2&orderby=$3&show=$4
  28. RewriteRule ^downloads.html gate.html?name=Downloads
  29. #Encyclopedia
  30. RewriteRule ^dic([1-9][0-9]*)all([a-zA-Z0-9]*).* gate.html?name=Encyclopedia&op=terms&eid=$1&ltr=$2
  31. RewriteRule ^term([1-9][0-9]*)-([1-9][0-9]*).* gate.html?name=Encyclopedia&op=content&tid=$1&page=$2
  32. RewriteRule ^term([1-9][0-9]*).* gate.html?name=Encyclopedia&op=content&tid=$1
  33. RewriteRule ^dic([1-9][0-9]*).* gate.html?name=Encyclopedia&op=list_content&eid=$1
  34. RewriteRule ^encyclopedia.* gate.html?name=Encyclopedia&file=index
  35. #FAQ
  36. RewriteRule ^faq.html gate.html?name=FAQ&file=index
  37. RewriteRule ^faq-([a-zA-Z0-9+]*)-([0-9]*)-([a-zA-Z0-9+]*) gate.html?name=FAQ&myfaq=$1&id_cat=$2&categories=$3
  38. #Forums
  39. RewriteRule ^forums.* gate.html?name=Forums&file=index
  40. RewriteRule ^forums.* gate.html?name=Forums&file=index&mark=forums
  41. RewriteRule ^fcat([0-9]*).* gate.html?name=Forums&file=index&c=$1
  42. RewriteRule ^forum([0-9]*).* gate.html?name=Forums&file=viewforum&f=$1&mark=topic
  43. RewriteRule ^viewforum([0-9]*)-([0-9]*)-([0-9]*).* gate.html?name=Forums&file=viewforum&f=$1&topicdays=$2&start=$3
  44. RewriteRule ^forum([0-9]*).* gate.html?name=Forums&file=viewforum&f=$1
  45. RewriteRule ^ptopic([0-9]*).* gate.html?name=Forums&file=viewtopic&t=$1&view=previous
  46. RewriteRule ^ntopic([0-9]*).* gate.html?name=Forums&file=viewtopic&t=$1&view=next
  47. RewriteRule ^watchtopic([0-9]*)-([0-9]*).* gate.html?name=Forums&file=viewtopic&t=$1&watch=topic&start=$2
  48. RewriteRule ^unwatchtopic([0-9]*)-([0-9]*).* gate.html?name=Forums&file=viewtopic&t=$1&unwatch=topic&start=$2
  49. RewriteRule ^ftopic([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* gate.html?name=Forums&file=viewtopic&t=$1&postdays=$2&postorder=$3&start=$4
  50. RewriteRule ^ftopic([0-9]*)-([0-9]*).* gate.html?name=Forums&file=viewtopic&t=$1&start=$2
  51. RewriteRule ^ftopic([0-9]*).* gate.html?name=Forums&file=viewtopic&t=$1
  52. RewriteRule ^ftopic([0-9]*).html gate.html?name=Forums&file=viewtopic&t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5
  53. RewriteRule ^author-([a-zA-Z0-9+=]*).html gate.html?name=Forums&file=search&search_author=$1
  54. RewriteRule ^member-([a-zA-Z0-9+=]*)-([0-9]*).html gate.html?name=Forums&file=profile&mode=$1&u=$2
  55. RewriteRule ^sutra([0-9]*).* gate.html?name=Forums&file=viewtopic&p=$1
  56. #Members
  57. RewriteRule ^members.html gate.html?name=Members_List
  58. RewriteRule ^members.html gate.html?name=Members_List&file=index
  59. RewriteRule ^members-mode([a-zA-Z0-9]*)-([a-zA-Z0-9]*)-([0-9]*).html gate.html?name=Members_List&file=index&mode=$1&order=$2&start=$3
  60. #Reviews
  61. RewriteRule ^reviews.html gate.html?name=Reviews
  62. RewriteRule ^review([0-9]*).html gate.html?name=Reviews&rop=showcontent&id=$1
  63. RewriteRule ^reviews-new.html gate.html?name=Reviews&rop=write_review
  64. RewriteRule ^reviews-sortby-([a-zA-Z0-9]*).html gate.html?name=Reviews&rop=$1
  65. RewriteRule ^reviews-comment-([0-9]*)-([a-zA-Z0-9]*) gate.html?name=Reviews&rop=postcomment&id=$1&title=$2
  66. RewriteRule ^review([0-9]*)-delete.html gate.html?name=Reviews&rop=del_review&id_del=$1
  67. RewriteRule ^review([0-9]*)-edit.html gate.html?name=Reviews&rop=mod_review&id=$1
  68. #Stories Archive
  69. RewriteRule ^archive.html gate.html?name=Stories_Archive
  70. RewriteRule ^allarticles.html gate.html?name=Stories_Archive&sa=show_all
  71. RewriteRule ^allarticles-([0-9]*).html gate.html?name=Stories_Archive&sa=show_all&min=$1
  72. RewriteRule ^archive([0-9]*)-([0-9]*).* gate.html?name=Stories_Archive&sa=show_month&year=$1&month=$2&month_l=$3
  73. #Surveys
  74. RewriteRule ^surveys.html gate.html?name=Surveys
  75. RewriteRule ^survey([a-zA-Z0-9]*)results.html gate.html?name=Surveys&op=results&pollID=$1
  76. RewriteRule ^survey([a-zA-Z0-9]*).html gate.html?name=Surveys&pollID=$1
  77. #Top10
  78. RewriteRule ^top.html gate.html?name=Top
  79. #Topics
  80. RewriteRule ^topics.html gate.html?name=Stories_Archive
  81. #Web Links
  82. RewriteRule ^addlink.html gate.html?name=Web_Links&l_op=AddLink
  83. RewriteRule ^randomlink.html gate.html?name=Web_Links&l_op=RandomLink
  84. RewriteRule ^toplinks.html gate.html?name=Web_Links&l_op=TopRated
  85. RewriteRule ^poplinks.html gate.html?name=Web_Links&l_op=MostPopular
  86. RewriteRule ^newlinks.html gate.html?name=Web_Links&l_op=NewLinks
  87. RewriteRule ^newlinksw-([0-9]*).html gate.html?name=Web_Links&l_op=NewLinks&newlinkshowdays=$1
  88. RewriteRule ^newlinksd-([0-9]*).html gate.html?name=Web_Links&l_op=NewLinksDate&selectdate=$1
  89. RewriteRule ^vlink([0-9]*).html gate.html?name=Web_Links&l_op=visit&lid=$1
  90. RewriteRule ^links([0-9]*).html gate.html?name=Web_Links&l_op=viewlink&cid=$1
  91. RewriteRule ^linkorder([0-9]*)-([a-zA-Z0-9]*).html gate.html?name=Web_Links&l_op=viewlink&cid=$1&orderby=$2
  92. RewriteRule ^links([0-9]*)-([0-9]*)-([a-zA-Z0-9]*)-([0-9]*).html gate.html?name=Web_Links&l_op=viewlink&cid=$1&min=$2&orderby=$3&show=$4
  93. #Your Account
  94. RewriteRule ^userinfo-([/:|\s\-\'{}().&_a-zA-Z0-9+=-]*).html gate.html?name=Your_Account&op=userinfo&uname=$1
  95. RewriteCond %{HTTP_HOST} !^www.otaugames.com$
  96. RewriteRule ^(.*)   http://www.otaugames.com/$1  [QSA,L,R=301]
  97. <Limit GET PUT POST>
  98. order allow,deny
  99. #Mettre ici les adresses ip à banir
  100. #deny from 192.168.150. 
  101. deny from 200.
  102. allow from all
  103. </Limit>
  104. # deny most common except .php
  105. <FilesMatch "\.(inc|tpl|h|ihtml|sql|ini|conf|class|bin|spd|theme|module|exe)$">
  106. deny from all
  107. </FilesMatch>
  108. <Files ~ "^\.ht">
  109. Order allow,deny
  110. Deny from all
  111. Satisfy All
  112. </Files>
  113. <Files ~ "\config.php$">
  114. deny from all
  115. </Files>
  116. ErrorDocument  400  http://www.otaugames.com/400.shtml
  117. ErrorDocument  401  http://www.otaugames.com/401.shtml
  118. ErrorDocument  403  http://www.otaugames.com/403.shtml
  119. ErrorDocument  404  http://www.otaugames.com/404.shtml
  120. ErrorDocument  500  http://www.otaugames.com/500.shtml


---------------
Otau Games : simulation automobile, jeu de voiture, jeu de course : tout pour votre bonheur !
Reply

Marsh Posté le 08-03-2005 à 19:45:06    

ca m'interresse pas plus que ca !!
c'etait pour voir si il n'y avais pas problemes dedans...


---------------
Nos estans firs di nosse pitite patreye...
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed