Issue with URL rewriting: ext doesn't work from root

Get help with installation and running phpBB 3.1.x here. Please do not post bug reports, feature requests, or extension related questions here.
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: phpBB 3.1.x is at its End of Life stage and support will NOT be provided after July 1st, 2018.
Locked
User avatar
gianluigi.zanettini
Registered User
Posts: 113
Joined: Fri Sep 07, 2007 9:09 pm
Location: Ferrara, Italy
Contact:

Issue with URL rewriting: ext doesn't work from root

Post by gianluigi.zanettini »

As suggested by extension developer VSE, I'm asking general help here because it seems that my board (phpBB 3.1.2) has some kind of issue with URL rewriting (even if Enable URL Rewriting: No).

When the the users try to close the announcement generated by the "Board Announcements" ext from phpBB root, the wrong path is called:

Code: Select all

/forum/boardannouncements/close?hash=XXX&sid=YYYf&_=ZZZ
From others pages, it works ok

Code: Select all

/forum/app.php/boardannouncements/close?hash=XXX&_=YYY
As you can see in the linked topic, the author already stated that this is not an issue with the extension itself.

Thanks for you support,
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5351
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: Issue with URL rewriting: ext doesn't work from root

Post by MattF »

Extensions don't determine what your URls will be. phpBB's route controller does. So the question is why is your board inconsistently dropping "app.php" from its URLs.
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
User avatar
sysz
Registered User
Posts: 278
Joined: Mon Jan 30, 2012 11:36 pm
Location: Sweden, Helsingborg
Name: Kimmy Lindell Ekström
Contact:

Re: Issue with URL rewriting: ext doesn't work from root

Post by sysz »

I found out how to fix it. It was not that easy to find out what was needed to be done. Big thanks to GoBieN, which seems to be the only one to actually explain in details what to do to fix this irritating problem.

Simply copy the text in the code field under in the quote by GoBieN and paste it into a (or create one) .htaccess file
GoBieN wrote:Maybe I was exagerating.
But check that you have a .htaccess file in your forum root and it contains the required section for app.php routing.

Code: Select all

<IfModule mod_rewrite.c>
RewriteEngine on

#
# 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
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]

Options +FollowSymLinks
</IfModule>
viewtopic.php?f=456&t=2246576&p=1394424 ... #p13944046

--------------------
I have the same kind of problem with the extension board rules and marc's board3 portal. I have not tried with the Board Announcements extension yet though.

The problem seems to happen when you visit the forum without the /index.php in the url. To get this error you can use my site http://forum.pokegarden.se/ and then visit the rule page (Which is translated to Regler in swedish) and then try it again with http://forum.pokegarden.se/index.php

In my case, my web hotel are using PHP Version 5.6.3 and mysql as database.
Currently working on the community
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5351
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: Issue with URL rewriting: ext doesn't work from root

Post by MattF »

sysz wrote:I found out how to fix it. It was not that easy to find out what was needed to be done. Big thanks to GoBieN, which seems to be the only one to actually explain in details what to do to fix this irritating problem.

Simply copy the text in the code field under in the quote by GoBieN and paste it into a (or create one) .htaccess file
GoBieN wrote:Maybe I was exagerating.
But check that you have a .htaccess file in your forum root and it contains the required section for app.php routing.

Code: Select all

<IfModule mod_rewrite.c>
RewriteEngine on

#
# 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
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]

Options +FollowSymLinks
</IfModule>
viewtopic.php?f=456&t=2246576&p=1394424 ... #p13944046

--------------------
I have the same kind of problem with the extension board rules and marc's board3 portal. I have not tried with the Board Announcements extension yet though.

The problem seems to happen when you visit the forum without the /index.php in the url. To get this error you can use my site http://forum.pokegarden.se/ and then visit the rule page (Which is translated to Regler in swedish) and then try it again with http://forum.pokegarden.se/index.php

In my case, my web hotel are using PHP Version 5.6.3 and mysql as database.
The code posted is already in phpBB's htaccess file. As our htaccess file says, If symbolic links are not already being followed, uncomment the line below, which is the Options +FollowSymLinks line.
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
User avatar
sysz
Registered User
Posts: 278
Joined: Mon Jan 30, 2012 11:36 pm
Location: Sweden, Helsingborg
Name: Kimmy Lindell Ekström
Contact:

Re: Issue with URL rewriting: ext doesn't work from root

Post by sysz »

Hmm, it seems like unrar or linux mint is removing or (hiding it) the .htaccess file when i am extracting the zip file cause it didn't find the .htaccess file in the folder but it sure is in the zip file now when i am looking :oops:

Thx VSE :)
Currently working on the community
User avatar
GoBieN
Registered User
Posts: 546
Joined: Fri Mar 05, 2004 5:22 pm
Location: Belgium
Contact:

Re: Issue with URL rewriting: ext doesn't work from root

Post by GoBieN »

All file starting with a . are hidden files on Linux. Windows shows it as a plain file.
Some FTP programs have a setting to show the hidden files, others show it by default.
When logged in on console/ssh on a Linux system you can see hidden files by using ls -al instead of ls to show directory contents.

If you did not activate the URL rewriting option in phpBB3.1 ACP, then URL's like /forum/app.php/page should work on Apache HTTPD. Maybe the +FollowSymLinks option is needed. I can't test it and don't know the details, I don't use Apache HTTPD.

For Nginx webserver you must configure URL rewriting for anything to work!
Last edited by GoBieN on Fri Feb 13, 2015 10:13 pm, edited 1 time in total.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 23055
Joined: Fri Aug 29, 2008 9:49 am

Re: Issue with URL rewriting: ext doesn't work from root

Post by Mick »

And can also be down to the host, some don't allow .htaccess files.
"The more connected we get the more alone we become" - Kyle Broflovski©
User avatar
sysz
Registered User
Posts: 278
Joined: Mon Jan 30, 2012 11:36 pm
Location: Sweden, Helsingborg
Name: Kimmy Lindell Ekström
Contact:

Re: Issue with URL rewriting: ext doesn't work from root

Post by sysz »

Once again thx guys for clearing that out :)
Currently working on the community
User avatar
gianluigi.zanettini
Registered User
Posts: 113
Joined: Fri Sep 07, 2007 9:09 pm
Location: Ferrara, Italy
Contact:

Re: Issue with URL rewriting: ext doesn't work from root

Post by gianluigi.zanettini »

Thank you all for your excellent support! I found out that phpBB's .htaccess was not being read. A quick AllowOverride all in the forum directory fixed the issue for me (see https://turbolab.it/forum )
Locked

Return to “[3.1.x] Support Forum”