Problem with WAMP

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

I'm currently doing something for a client which requires rewriting. I got all that working perfectly (phpBB3 SEO mod) but the problem I'm facing right now is that my local WAMP doesn't want to do what it is supposed to do.

I have the same problem with my own site... it rewrites perfectly on-line on my host, but it doesn't do it locally. Well, it rewrites, but I get a 404 error... I don't know what to do to get it fixed.

I need to make sure it works right so the client won't be unhappy with the product and that type of thing... I would greatly appreciate the help here... thank you :)
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

Well if it did the rewrite you wouldnt be getting the 404 would you ;)

Do you have modrewrite enabled in apache localy? I would check before you assume, and if you have enabled it before check again.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

It is on... I left click on the WAMP, go to Apache, then Apache modules, and then scroll down to rewrite_module. There is a check to the left of it, indicating that the module is on.

If I remove the rewrite stuff, the 404 page disappears and I see the phpBB3 forum like I'm supposed to see.

SpooF wrote:
Well if it did the rewrite you wouldnt be getting the 404 would you ;)

Your right... but it rewrites the URL but gives me the 404... maybe theres some internal problem, but the URL is rewritten...
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

Check your Apache logs to see where the URL is being rewritten to. Manually navigate to that page and make sure it's there.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

The URL is rewritten from http://127.0.0.1/mpeters/viewforum.php?f=2 to http://127.0.0.1/mpeters/your-first-forum/

And in the Apache Access Log it shows:

Quote:
127.0.0.1 - - [01/Feb/2010:16:26:57 -0600] "GET /mpeters/your-first-forum/ HTTP/1.1" 404 223
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

I think your getting your rule backwards you want to translate http://127.0.0.1/mpeters/your-first-forum/ to http://127.0.0.1/mpeters/viewforum.php?f=2

Apache should be getting a request for http://127.0.0.1/mpeters/viewforum.php?f=2
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

I'm so confused.

By default, the URL would be http://127.0.0.1/mpeters/viewforum.php?f=2, so I would want to rewrite that to http://127.0.0.1/mpeters/your-first-forum/, but for the Apache to still request for the http://127.0.0.1/mpeters/viewforum.php?f=2. I know it's possible since this site does it, my site does it... I just can't get it to work locally on my WAMP.

How do I fix my WAMP?
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

When you click a link on a website like ozzu:
programming-forum/problem-with-wamp-t102101.html

A normal phpbb link looks like this:
/viewtopic.php?f=46&t=1861645

modrewrite changes the url you click to something that apache can understand. It sits between the user and apache.

I'm not sure what modifications BWM has done to ozzu, but he needs to change the url you click, to something that can be used by apache, aka a query string.

Say I have a website that sells some product. My url might look like:
product.php?category=4&item=242
I want something a little more friendly to look at so I may create a modrewrite like the following:
RewriteRule ^product/([0-9]+)-(.*)/([0-9]+)-(.*)\.html product.php?category=$1&item=$2

This would change any url like the following:
product/123-Some-Catagory/231-Product-name.html => product.php?category=123&item=231

You might know this already and we are just completely miss understand each other lol
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

lol I hate misunderstanding people... this really slows down the process of solving problems :lol:

Anyway, I know what your saying. I'm trying to rewrite the url so the url would be like it is here... www.site.com/forum-category/topic-name-t123456.html

I'm trying to do what you described. The module for rewrite is enabled but the apache is looking for the things for the rewritten URL (I think... not sure).

Seems to me that Apache is looking for category your-first-forum rather then viewforum.php?f=2. How do I fix that so Apache looks for viewforum.php?f=2 while the URL says your-first-forum?
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

Can you post your mod_rewrite code?
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

The rewrite code came with the mod (http://www.phpbb-seo.com).

Below is the mod_rewrite code that it generated (It also gives me the option to have backslash on the left or on the right... I've tried them all.

Code: [ Select ]
# Lines That should already be in your .htacess
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>

# You may need to un-comment the following lines
# Options +FollowSymlinks
# To make sure that rewritten dir or file (/|.html) will not load dir.php in case it exist
# Options -MultiViews
# REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE
RewriteEngine On
# REWRITE BASE
RewriteBase /mpeters/
# HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN
# RewriteCond %{HTTP_HOST} !^127\.0\.0\.1$ [NC]
# RewriteRule ^(.*)$ http://127.0.0.1/mpeters/$1 [QSA,L,R=301]

# DO NOT GO FURTHER IF THE REQUESTED FILE / DIR DOES EXISTS
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
#####################################################
# PHPBB SEO REWRITE RULES ALL MODES
#####################################################
# AUTHOR : dcz www.phpbb-seo.com
# STARTED : 01/2006
#################################
# FORUMS PAGES
###############
# FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. "forum" REQUIRES TO BE SET AS FORUM INDEX
# RewriteRule ^/forum\.html$ index.php [QSA,L,NC]
# FORUM ALL MODES
RewriteRule ^/(forum|[a-z0-9_-]*-f)([0-9]+)/?(page([0-9]+)\.html)?$ viewforum.php?f=$2&start=$4 [QSA,L,NC]
# TOPIC WITH VIRTUAL FOLDER ALL MODES
RewriteRule ^/(forum|[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ viewtopic.php?f=$2&t=$4&start=$6 [QSA,L,NC]
# GLOBAL ANNOUNCES WITH VIRTUAL FOLDER ALL MODES
RewriteRule ^/announces/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ viewtopic.php?t=$2&start=$4 [QSA,L,NC]
# TOPIC WITHOUT FORUM ID & DELIM ALL MODES
RewriteRule ^/([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ viewtopic.php?forum_uri=$1&t=$3&start=$5 [QSA,L,NC]
# PHPBB FILES ALL MODES
RewriteRule ^/resources/[a-z0-9_-]+/(thumb/)?([0-9]+)$ download/file.php?id=$2&t=$1 [QSA,L,NC]
# PROFILES THROUGH USERNAME
RewriteRule ^/member/([^/]+)/?$ memberlist.php?mode=viewprofile&un=$1 [QSA,L,NC]
# USER MESSAGES THROUGH USERNAME
RewriteRule ^/member/([^/]+)/(topics|posts)/?(page([0-9]+)\.html)?$ search.php?author=$1&sr=$2&start=$4 [QSA,L,NC]
# GROUPS ALL MODES
RewriteRule ^/(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ memberlist.php?mode=group&g=$2&start=$4 [QSA,L,NC]
# POST
RewriteRule ^/post([0-9]+)\.html$ viewtopic.php?p=$1 [QSA,L,NC]
# ACTIVE TOPICS
RewriteRule ^/active-topics(-([0-9]+))?\.html$ search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
# UNANSWERED TOPICS
RewriteRule ^/unanswered(-([0-9]+))?\.html$ search.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
# NEW POSTS
RewriteRule ^/newposts(-([0-9]+))?\.html$ search.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
# THE TEAM
RewriteRule ^/the-team\.html$ memberlist.php?mode=leaders [QSA,L,NC]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES

# FORUM WITHOUT ID & DELIM ALL MODES (SAME DELIM)
# THESE THREE LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/([a-z0-9_-]+)/?(page([0-9]+)\.html)?$ viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
# FIX RELATIVE PATHS : FILES
RewriteRule ^/.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$ $1 [QSA,L,NC,R=301]
# FIX RELATIVE PATHS : IMAGES
RewriteRule ^/.+/(styles/.*|images/.*)/$ $1 [QSA,L,NC,R=301]
# END PHPBB PAGES
#####################################################
  1. # Lines That should already be in your .htacess
  2. <Files "config.php">
  3. Order Allow,Deny
  4. Deny from All
  5. </Files>
  6. <Files "common.php">
  7. Order Allow,Deny
  8. Deny from All
  9. </Files>
  10. # You may need to un-comment the following lines
  11. # Options +FollowSymlinks
  12. # To make sure that rewritten dir or file (/|.html) will not load dir.php in case it exist
  13. # Options -MultiViews
  14. # REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE
  15. RewriteEngine On
  16. # REWRITE BASE
  17. RewriteBase /mpeters/
  18. # HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN
  19. # RewriteCond %{HTTP_HOST} !^127\.0\.0\.1$ [NC]
  20. # RewriteRule ^(.*)$ http://127.0.0.1/mpeters/$1 [QSA,L,R=301]
  21. # DO NOT GO FURTHER IF THE REQUESTED FILE / DIR DOES EXISTS
  22. RewriteCond %{REQUEST_FILENAME} -f
  23. RewriteCond %{REQUEST_FILENAME} -d
  24. RewriteRule . - [L]
  25. #####################################################
  26. # PHPBB SEO REWRITE RULES ALL MODES
  27. #####################################################
  28. # AUTHOR : dcz www.phpbb-seo.com
  29. # STARTED : 01/2006
  30. #################################
  31. # FORUMS PAGES
  32. ###############
  33. # FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. "forum" REQUIRES TO BE SET AS FORUM INDEX
  34. # RewriteRule ^/forum\.html$ index.php [QSA,L,NC]
  35. # FORUM ALL MODES
  36. RewriteRule ^/(forum|[a-z0-9_-]*-f)([0-9]+)/?(page([0-9]+)\.html)?$ viewforum.php?f=$2&start=$4 [QSA,L,NC]
  37. # TOPIC WITH VIRTUAL FOLDER ALL MODES
  38. RewriteRule ^/(forum|[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ viewtopic.php?f=$2&t=$4&start=$6 [QSA,L,NC]
  39. # GLOBAL ANNOUNCES WITH VIRTUAL FOLDER ALL MODES
  40. RewriteRule ^/announces/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ viewtopic.php?t=$2&start=$4 [QSA,L,NC]
  41. # TOPIC WITHOUT FORUM ID & DELIM ALL MODES
  42. RewriteRule ^/([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ viewtopic.php?forum_uri=$1&t=$3&start=$5 [QSA,L,NC]
  43. # PHPBB FILES ALL MODES
  44. RewriteRule ^/resources/[a-z0-9_-]+/(thumb/)?([0-9]+)$ download/file.php?id=$2&t=$1 [QSA,L,NC]
  45. # PROFILES THROUGH USERNAME
  46. RewriteRule ^/member/([^/]+)/?$ memberlist.php?mode=viewprofile&un=$1 [QSA,L,NC]
  47. # USER MESSAGES THROUGH USERNAME
  48. RewriteRule ^/member/([^/]+)/(topics|posts)/?(page([0-9]+)\.html)?$ search.php?author=$1&sr=$2&start=$4 [QSA,L,NC]
  49. # GROUPS ALL MODES
  50. RewriteRule ^/(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ memberlist.php?mode=group&g=$2&start=$4 [QSA,L,NC]
  51. # POST
  52. RewriteRule ^/post([0-9]+)\.html$ viewtopic.php?p=$1 [QSA,L,NC]
  53. # ACTIVE TOPICS
  54. RewriteRule ^/active-topics(-([0-9]+))?\.html$ search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
  55. # UNANSWERED TOPICS
  56. RewriteRule ^/unanswered(-([0-9]+))?\.html$ search.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
  57. # NEW POSTS
  58. RewriteRule ^/newposts(-([0-9]+))?\.html$ search.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
  59. # THE TEAM
  60. RewriteRule ^/the-team\.html$ memberlist.php?mode=leaders [QSA,L,NC]
  61. # HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES
  62. # FORUM WITHOUT ID & DELIM ALL MODES (SAME DELIM)
  63. # THESE THREE LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
  64. RewriteCond %{REQUEST_FILENAME} !-f
  65. RewriteCond %{REQUEST_FILENAME} !-d
  66. RewriteRule ^/([a-z0-9_-]+)/?(page([0-9]+)\.html)?$ viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
  67. # FIX RELATIVE PATHS : FILES
  68. RewriteRule ^/.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$ $1 [QSA,L,NC,R=301]
  69. # FIX RELATIVE PATHS : IMAGES
  70. RewriteRule ^/.+/(styles/.*|images/.*)/$ $1 [QSA,L,NC,R=301]
  71. # END PHPBB PAGES
  72. #####################################################
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

Nothing?
  • dark_lord
  • Graduate
  • Graduate
  • User avatar
  • Posts: 162
  • Loc: India-Kolkata

Post 3+ Months Ago

i can give a try.

You need to put the .htaccess under htdocs folder
which means under http://localhost/ or htt://127.0.0.1/

even if u have have installation under some directory htdocs/phpbb or http://localhost/phpbb

and in

.htaccess file i will highly recommend that you change this line

# RewriteCond %{HTTP_HOST} !^127\.0\.0\.1$ [NC]
# RewriteRule ^(.*)$ http://127.0.0.1/mpeters/$1 [QSA,L,R=301]

to

# RewriteCond %{HTTP_HOST} !^127\.0\.0\.1$ [NC]
# RewriteRule ^(.*)$ http://127.0.0.1/$1 [QSA,L,R=301]


OR (what i have done)


# RewriteCond %{HTTP_HOST} !^localhost$ [NC]
# RewriteRule ^(.*)$ http://localhost/$1 [QSA,L,R=301]
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

Putting the .htaccess file seems to fix it, but now it gives me a 404 every time I try to access a page that isn't rewritten... like portal.php and the adm/index.php :(
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

I now get the following error when I try to enter admin control panel!
Quote:
[Mon Feb 08 22:39:57 2010] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/adm, referer: http://127.0.0.1/forum.html
[Mon Feb 08 22:40:01 2010] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

Might add something like this:

Code: [ Select ]
RewriteCond $1 !^(assets|uploads|robots\.txt)


just edit it to fit what you need. Basically if it finds a match it will ignore it and not do the mod rewrite for them. So if you want to leave your adm folder alone.

Code: [ Select ]
RewriteCond $1 !^(adm)

Post Information

  • Total Posts in this topic: 16 posts
  • Users browsing this forum: No registered users and 145 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.