phpBBSEO / usu

Ultimate SEO URL
32 stars 25 forks source link

404 ? The forum you selected does not exist. #116

Open lddd opened 8 years ago

lddd commented 8 years ago

On all rewrites instead of index.php i get the message: [b]The forum you selected does not exist.[/b]

I am running phpBB in root directory of the domain

[quote] # phpbb uses index.htm index index.php index.html index.htm;

           # DO NOT GO FURTHER IF THE REQUESTED FILE / DIR DOES EXISTS
           if (-e $request_filename) {
                break;
           }
           # FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. "forum" REQUIRES TO BE SET AS FORUM INDEX
           # rewrite ^/forum\.html$ /index.php last;
           # FORUM ALL MODES
           rewrite ^/(forum|[a-z0-9_-]*-f)([0-9]+)/?(page([0-9]+)\.html)?$ /viewforum.php?f=$2&start=$4 last;
           # TOPIC WITH VIRTUAL FOLDER ALL MODES
           rewrite ^/(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 last;
           # TOPIC WITHOUT FORUM ID & DELIM ALL MODES
           rewrite ^/([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php?forum_uri=$1&t=$3&start=$5 last;
           # PROFILES ALL MODES WITH ID
           rewrite ^/(member|[a-z0-9_-]*-u)([0-9]+)/?$ /memberlist.php?mode=viewprofile&u=$2 last;
           # USER MESSAGES ALL MODES WITH ID
           rewrite ^/(member|[a-z0-9_-]*-u)([0-9]+)/(topics|posts)/?(page([0-9]+)\.html)?$ /search.php?author_id=$2&sr=$3&start=$5 last;
           # GROUPS ALL MODES
           rewrite ^/(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ /memberlist.php?mode=group&g=$2&start=$4 last;
           # POSTS
           rewrite ^/post([0-9]+)\.html$ /viewtopic.php?p=$1 last;
           # ACTIVE TOPICS
           rewrite ^/active-topics(-([0-9]+))?\.html$ /search.php?search_id=active_topics&start=$2&sr=topics last;
           # UNANSWERED TOPICS
           rewrite ^/unanswered(-([0-9]+))?\.html$ /search.php?search_id=unanswered&start=$2&sr=topics last;
           # NEW POSTS
           rewrite ^/newposts(-([0-9]+))?\.html$ /search.php?search_id=newposts&start=$2&sr=topics last;
           # UNREAD POSTS
           rewrite ^/unreadposts(-([0-9]+))?\.html$ /search.php?search_id=unreadposts&start=$2 last;
           # THE TEAM
           rewrite ^/the-team\.html$ /memberlist.php?mode=team last;
           # HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES

           # FORUM WITHOUT ID & DELIM ALL MODES
           # THESE LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
           if (!-e $request_filename) {
                rewrite ^/([a-z0-9_-]+)/?(page([0-9]+)\.html)?$ /viewforum.php?forum_uri=$1&start=$3 last;
           }
           # FIX RELATIVE PATHS : FILES
           rewrite ^/(style\.php|ucp\.php|mcp\.php|faq\.php|posting\.php|download/file\.php|report\.php|adm/index\.php|cron\.php)$ /$1 permanent;
           # FIX RELATIVE PATHS : IMAGES
           rewrite ^/(styles/.*|images/.*|assets/.*|ext/.*)$ /$1 permanent;
           #
           # The following 3 lines will rewrite URLs passed through the front controller
           # to not require app.php in the actual URL. In other words, a controller is
           # by default accessed at /app.php/my/controller, but can also be accessed at
           # /my/controller
           #
           if (!-e $request_filename) {
                rewrite ^/(.*)$ /app.php last;
           }

      }[/quote]

Cany anyone tell me whats wrong?

lddd commented 8 years ago

Hm, great support.

LotusJeff commented 8 years ago

Extensions underdevelopment are use at your own risk. I imagine USU will provide support for his development code, but for rewrite rules, you should be able to do basic troubleshooting yourself.

Rewrite rules are very simple and basic to trouble shoot. Turn on your rewrite error log and see where the page is being routed to. this will give you the beginning url and the ending url. From there it is a simple review of the issue.

Additionally,

  1. Did you clear the caches?
  2. Did you validate the forum was working before installing the extension?
  3. Did you install the extension correctly?

It does work on NGINX with 3.1.17. I have it running on my test server.

lddd commented 8 years ago

Hello there,

thanks for your kind words. Appreaciate it.

I did steps 1-3, yes. Everything should be fine here. What makes me wonder is the fact. I also installed a new test forum and after some troubles having the same issues there is works like a charm.

However on my main forum which is almost new too (no further extensions, everything pretty much basic) its not.

Now i have 1:1 the same settings for the working test forum and the almost existing one (that doesn´t work). And also the rewrite rules matches.

Active topics, search, members and even the single topics are working fine. But the forum sections not.

I will try to debug the rewrite logs now.

wcz-txp commented 8 years ago

Hello, did you make your configuration in the Forum URL Management section? Are the URLs cached and do you see the final url? What says the cache file status?

Cache file status:
The cache directory configured is : /var/www/forum/ext/phpbbseo/usu/cache/
The cache directory was successfully found.
The cache directory is writable.
lddd commented 8 years ago

Yes it did. Thanks.

Here an output of my virtual host error log.

2016/04/12 11:51:13 [debug] 12452#0: *5 http fastcgi record length: 8 2016/04/12 11:51:13 [debug] 12452#0: *5 http fastcgi sent end request 2016/04/12 11:51:13 [debug] 12452#0: *5 input buf 00007F1D34987DF4 3332 2016/04/12 11:51:13 [debug] 12452#0: *5 pipe write downstream: 1 2016/04/12 11:51:13 [debug] 12452#0: *5 pipe write downstream flush in 2016/04/12 11:51:13 [debug] 12452#0: *5 http output filter "/viewforum.php?forum_uri=general-forum-sectione&start=" 2016/04/12 11:51:13 [debug] 12452#0: *5 http copy filter: "/viewforum.php?forum_uri=general-forum-section&start=" 2016/04/12 11:51:13 [debug] 12452#0: *5 image filter 2016/04/12 11:51:13 [debug] 12452#0: *5 xslt filter body 2016/04/12 11:51:13 [debug] 12452#0: *5 http postpone filter "/viewforum.php?forum_uri=general-forum-section&start=" 00007F1D34987778 2016/04/12 11:51:13 [debug] 12452#0: *5 http chunk: 3332 2016/04/12 11:51:13 [debug] 12452#0: *5 write old buf t:1 f:0 00007F1D349873A8, pos 00007F1D349873A8, size: 683 file: 0, size: 0 2016/04/12 11:51:13 [debug] 12452#0: *5 write new buf t:1 f:0 00007F1D349878B8, pos 00007F1D349878B8, size: 5 file: 0, size: 0 2016/04/12 11:51:13 [debug] 12452#0: *5 write new buf t:1 f:0 00007F1D34987BB0, pos 00007F1D34987DF4, size: 3332 file: 0, size: 0 2016/04/12 11:51:13 [debug] 12452#0: *5 write new buf t:0 f:0 0000000000000000, pos 00007F1D32FA6E7D, size: 2 file: 0, size: 0 2016/04/12 11:51:13 [debug] 12452#0: *5 http write filter: l:0 f:0 s:4022 2016/04/12 11:51:13 [debug] 12452#0: *5 http write filter limit 0 2016/04/12 11:51:13 [debug] 12452#0: *5 writev: 4022 2016/04/12 11:51:13 [debug] 12452#0: *5 http write filter 0000000000000000 2016/04/12 11:51:13 [debug] 12452#0: *5 http copy filter: 0 "/viewforum.php?forum_uri=general-forum-section&start=" 2016/04/12 11:51:13 [debug] 12452#0: *5 pipe write downstream done 2016/04/12 11:51:13 [debug] 12452#0: *5 event timer: 30, old: 1460454733910, new: 1460454733972 2016/04/12 11:51:13 [debug] 12452#0: *5 http upstream exit: 0000000000000000 2016/04/12 11:51:13 [debug] 12452#0: *5 finalize http upstream request: 0 2016/04/12 11:51:13 [debug] 12452#0: *5 finalize http fastcgi request 2016/04/12 11:51:13 [debug] 12452#0: *5 free rr peer 1 0 2016/04/12 11:51:13 [debug] 12452#0: *5 close http upstream connection: 30 2016/04/12 11:51:13 [debug] 12452#0: *5 free: 00007F1D349EE510, unused: 48 2016/04/12 11:51:13 [debug] 12452#0: *5 event timer del: 30: 1460454733910 2016/04/12 11:51:13 [debug] 12452#0: *5 reusable connection: 0 2016/04/12 11:51:13 [debug] 12452#0: *5 http upstream temp fd: -1 2016/04/12 11:51:13 [debug] 12452#0: *5 http output filter "/viewforum.php?forum_uri=general-forum-section&start=" 2016/04/12 11:51:13 [debug] 12452#0: *5 http copy filter: "/viewforum.php?forum_uri=generla-forum-section&start=" 2016/04/12 11:51:13 [debug] 12452#0: *5 image filter 2016/04/12 11:51:13 [debug] 12452#0: *5 xslt filter body 2016/04/12 11:51:13 [debug] 12452#0: *5 http postpone filter "/viewforum.php?forum_uri=generla-forum-section&start=" 00007FFD08DE10C0 2016/04/12 11:51:13 [debug] 12452#0: *5 http chunk: 0 2016/04/12 11:51:13 [debug] 12452#0: *5 write new buf t:0 f:0 0000000000000000, pos 00007F1D32FA6E7A, size: 5 file: 0, size: 0 2016/04/12 11:51:13 [debug] 12452#0: *5 http write filter: l:1 f:0 s:5 2016/04/12 11:51:13 [debug] 12452#0: *5 http write filter limit 0 2016/04/12 11:51:13 [debug] 12452#0: *5 writev: 5 2016/04/12 11:51:13 [debug] 12452#0: *5 http write filter 0000000000000000 2016/04/12 11:51:13 [debug] 12452#0: *5 http copy filter: 0 "/viewforum.php?forum_uri=general-forum-section&start=" 2016/04/12 11:51:13 [debug] 12452#0: *5 http finalize request: 0, "/viewforum.php?forum_uri=genera-forum-section&start=" a:1, c:1 2016/04/12 11:51:13 [debug] 12452#0: *5 set http keepalive handler 2016/04/12 11:51:13 [debug] 12452#0: *5 http close request 2016/04/12 11:51:13 [debug] 12452#0: *5 http log handler 2016/04/12 11:51:13 [debug] 12452#0: *5 run cleanup: 00007F1D34914F78 2016/04/12 11:51:13 [debug] 12452#0: *5 close cached open file: /srv/www/domain.com/public_htm/viewforum.php, fd:29, c:0, u:1, 0 2016/04/12 11:51:13 [debug] 12452#0: *5 free: 00007F1D34987BB0 2016/04/12 11:51:13 [debug] 12452#0: *5 free: 00007F1D349C08E0, unused: 0 2016/04/12 11:51:13 [debug] 12452#0: *5 free: 00007F1D34914A40, unused: 0 2016/04/12 11:51:13 [debug] 12452#0: *5 free: 00007F1D34986BA0, unused: 238 2016/04/12 11:51:13 [debug] 12452#0: *5 free: 00007F1D34A39280 2016/04/12 11:51:13 [debug] 12452#0: *5 hc free: 0000000000000000 0 2016/04/12 11:51:13 [debug] 12452#0: *5 hc busy: 0000000000000000 0 2016/04/12 11:51:13 [debug] 12452#0: *5 tcp_nodelay 2016/04/12 11:51:13 [debug] 12452#0: *5 reusable connection: 1 2016/04/12 11:51:13 [debug] 12452#0: *5 event timer add: 28: 65000:1460454738972 2016/04/12 11:51:13 [debug] 12452#0: *5 post event 00007F1D2AFD3218 2016/04/12 11:51:13 [debug] 12452#0: *5 delete posted event 00007F1D2AFD3218 2016/04/12 11:51:13 [debug] 12452#0: *5 http keepalive handler 2016/04/12 11:51:13 [debug] 12452#0: *5 malloc: 00007F1D34A39280:32768 2016/04/12 11:51:13 [debug] 12452#0: *5 recv: fd:28 -1 of 32768 2016/04/12 11:51:13 [debug] 12452#0: *5 recv() not ready (11: Resource temporarily unavailable) 2016/04/12 11:51:13 [debug] 12452#0: *5 free: 00007F1D34A39280

Not sure what do see here regarding rewrite rules not working

lddd commented 8 years ago

config.runtime.php.current seems to be ok fine. All sections in there.

wcz-txp commented 8 years ago

Is this your forum url general-forum-sectione? Try to deactivate Forum ID Removing:, it is easier without, when you not really understand how rewriting works. The same for Virtual Folder: Is Forum URL caching: activated?

lddd commented 8 years ago

Its everything to YES instead of "remove small words"

general-forum-sectione as seen in the logs is not correct its general-forum-section for sure. But thats because i edited the log file for here. Should be fine.

Not sure why i cannot see any 404 error in the logs? So why does it says this message that "the forum does not exist" ?

wcz-txp commented 8 years ago

So switch Forum ID Removing: and Virtual Folder: off ... clear the cache and then recheck the cached forum names. After that it should work.

lddd commented 8 years ago

The cache file was updated successfully.

No route found for "GET /general-forum-section.html"

lddd commented 8 years ago

Updated the nginx conf again and restarted webserver. Now thing have changed with these settings described by you wcz-txp.

Now i have links like general-forum-section-f10.html

thats is working.

But now, URLS like general-forum-section/ should work too or?

wcz-txp commented 8 years ago

no, for that you have to activate Virtual Folder: and to change # FORUM ALL MODES rewrite ^/(forum|[a-z0-9_-]*-f)([0-9]+)/?(page([0-9]+)\.html)?$ /viewforum.php?f=$2&start=$4 last;

to something like that .... rewrite ^/(forum|[a-z0-9_-]*-f)([0-9]+)/?(page([0-9]+))?$ /viewforum.php?f=$2&start=$4 last;`

lddd commented 8 years ago

thanks a lot. Awesome.

lddd commented 8 years ago

It keeps logging me out of the Admin/Mod Panels after short time. :(

wcz-txp commented 8 years ago

In this case you should first check, if this is caused by USU or by some security or server settings. Maybe your IP address is often changed or something is wrong with your cookie settings. Otherwise check if the sid is in your url like that /adm/index.php?sid= ...

lddd commented 8 years ago

Thanks @wcz. I noticed another redirect problem. This happens if a user logs in to the forum. It doesn´t redirect the user to the current topic/page he is reading/writing.

Instead he gets a error message like: _No route found for GET /the-topic-the-user-is-reading... _

The URL in browser looks like: domain.com/viewtopic.php?/the-topic-the-user-is-reading

So the viewtopic.php? is useless and needs to be removed from the URL the user gets redirected if logs in.

Just dont know how. Thanks for your kind help.

lddd commented 8 years ago

Anyone?

lddd commented 8 years ago

:(