Forum

PHPBB rewrite toolkit

Kapageridis Stavros
4 September 2016, 00:48
Hi Hugo, i know it's dummy to ask for this every time but i can't figure it out. PHPBB is working perfect until i choose to enable the url rewrite option. I need your help with that. Anytime you can, make the toolkit for this.

The .htaccess file contains:
<IfModule mod_rewrite.c>
RewriteEngine on

#
# Uncomment the statement below if URL rewriting doesn't
# work properly. If you installed phpBB in a subdirectory
# of your site, properly set the argument for the statement.
# e.g.: if your domain is test.com and you installed phpBB
# in http://www.test.com/phpBB/index.php you have to set
# the statement RewriteBase /phpBB/
#
#RewriteBase /

#
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
#
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

#
# 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]

#
# If symbolic links are not already being followed,
# uncomment the line below.
# http://anothersysadmin.wordpress.com/2008/06/10/mod_rewrite-forbidden-403-with-apache-228/
#
#Options +FollowSymLinks
</IfModule>

# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from
# module mod_authz_host to a new module called mod_access_compat (which may be
# disabled) and a new "Require" syntax has been introduced to mod_authz_host.
# We could just conditionally provide both versions, but unfortunately Apache
# does not explicitly tell us its version if the module mod_version is not
# available. In this case, we check for the availability of module
# mod_authz_core (which should be on 2.4 or higher only) as a best guess.
<IfModule mod_version.c>
<IfVersion < 2.4>
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
</IfVersion>
<IfVersion >= 2.4>
<Files "config.php">
Require all denied
</Files>
<Files "common.php">
Require all denied
</Files>
</IfVersion>
</IfModule>
<IfModule !mod_version.c>
<IfModule !mod_authz_core.c>
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
</IfModule>
<IfModule mod_authz_core.c>
<Files "config.php">
Require all denied
</Files>
<Files "common.php">
Require all denied
</Files>
</IfModule>
</IfModule>


Regards
Hugo Leisink
7 September 2016, 10:26
How about this:
UrlToolkit {
ToolkitID = phpBB
RequestURI exists Return
Match [^?]*(\?.*)? Rewrite /app.php$1
}
Kapageridis Stavros
7 September 2016, 14:55
Hi Hugo and thank you very much. It looks that it works. In case that i have an issue i will update you. Please add this toolkit to the Toolkit collection you have here.

Regards
Hugo Leisink
7 September 2016, 14:57
Please add this toolkit to the Toolkit collection you have here.

Hey... that was my idea!!
Kapageridis Stavros
7 September 2016, 15:37
Also i must mention that there is an issue with PHPBB and Hiawatha(maybe it is only to my Hiawatha webserver and caused from my mistake). When i add an extension to PHPBB it open it in address like https://domain.tld/extension, in my hiawatha webserver this returns as result an error page cause hiawatha do not open url's without extension. I notice the same to another script too. Anyway, i manage this by adding NoExtensionAs = php , to my virtual host configuration.
Hugo Leisink
7 September 2016, 15:39
And the /extension points to an actual file on disk? And requests for such extensions should not be handled via /app.php?
Kapageridis Stavros
7 September 2016, 15:55
The extension points to /rules(rules is the extension i add), without the toolkit it was returning an error page, after the toolkit added it works correctly even without the "NoExtensionAs = php" in virtual host conf.
kapageridis Stavros
7 September 2016, 15:56
Do you allow me to post the url where i run the phpbb ?
Hugo Leisink
7 September 2016, 15:57
Sure. Just don't add too much URL's in one post. Otherwise it is seen as spam.
Kapageridis Stavros
7 September 2016, 16:05
The url is https://phpbb.hiawatha.ovh/.
The phpbb rewrite is not so search engine friendly or i mess something there:) ,please try to check the url's of the first category , first post and any other on the forum. Most times it returns <filename>.php and nothing like domain.tld/forum/category/post .
It gives me understand that the rewrite is done only to avoid of app.php on url.
Hugo Leisink
7 September 2016, 16:11
I don't receive the account activation e-mail from your forum.
Kapageridis Stavros
7 September 2016, 16:20
Ofcourse you not. Because i am so brilliant that i have not start the mail server. Also i am so paranoid that i block all tcp connections to my server except ports : 21,80,443. And a dozen IP's(update server, monitor services, etc)
Give me a couple minutes to fix that.
Kapageridis Stavros
7 September 2016, 16:22
I am sorry for all this. I just verify your account.
Hugo Leisink
7 September 2016, 16:26
I keep getting the error 'The submitted form was invalid. Try submitting again'. Seems you have some work to do first.
Kapageridis Stavros
7 September 2016, 16:28
Yes Hugo, this is true. There is needed much more work on the server to make it work correctly 100%.
Kapageridis Stavros
7 September 2016, 16:34
Maybe it was the phpbb permission settings. I give you full permissions.
This topic has been closed.