htaccess or something messes up URL

Get help with installation and running phpBB 3.1.x here. Please do not post bug reports, feature requests, or extension related questions here.
Anti-Spam Guide
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
biosek
Registered User
Posts: 16
Joined: Sat Jan 31, 2015 2:57 pm

htaccess or something messes up URL

Post by biosek »

Hi,
I have webhosting at wedos.cz , they have folder structure like this:
www/domains/
www/subdom/
www/.htaccess

this htaccess is this:

Code: Select all

# htaccess rules for subdomains and aliases
# to create new subdomain, create a folder www/subdom/(subdomain name)
# to create web for alias, create a folder www/domains/(whole domain name)

# htaccess pravidla pro subdomeny a samostatne weby aliasu
# pro vytvoreni subdomeny vytvorte adresar www/subdom/(nazev subdomeny)
# pro vytvoreni webu pro alias vytvorte adresar www/domains/(cely domenovy nazev)
# dalsi info a priklady: http://kb.wedos.com/r/32/webhosting-htaccess.html

RewriteEngine On

# cele domeny (aliasy)
RewriteCond %{REQUEST_URI} !^domains/
RewriteCond %{REQUEST_URI} !^/domains/
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$
RewriteCond %{DOCUMENT_ROOT}/domains/%2 -d
RewriteRule (.*) domains/%2/$1 [DPI]

# subdomeny (s nebo bez www na zacatku)
RewriteCond %{REQUEST_URI} !^subdom/
RewriteCond %{REQUEST_URI} !^/subdom/
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)\.([^\.]*)\.([^\.]*)$
RewriteCond %{DOCUMENT_ROOT}/subdom/%2 -d
RewriteRule (.*) subdom/%2/$1 [DPI]

# aliasy - spravne presmerovani pri chybejicim /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^domains/[^/]+/(.+[^/])$ /$1/ [R]

# subdomeny - spravne presmerovani pri chybejicim /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^subdom/[^/]+/(.+[^/])$ /$1/ [R]
It should translate all adresses from folders in /www/domains/ into actual domain urls.

So for example. Lets say I have /www/domains/example.cz/index.html, then when i write http://example.cz/ into browser it shows up index.html

BUT there is an issue with phpbb forums (new 3.1.3 and also old 3.0.12)
In new 3.1.3 when I open the forum at (lets say) http://example.cz/ it is fine. But when I log in to the forum the url changes to http://example.cz/domains/example.cz/index.php?sid=***********

I haven't learned about htaccess files yet, but my guess is, that forum's htaccess file has something to do with it.

This also happens on our old forum which runs on 3.0.12 phpbb version.

Anyone have any suggestion, what could cause the problem?
Thank you in advance.
User avatar
Lumpy Burgertushie
Registered User
Posts: 68587
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: htaccess or something messes up URL

Post by Lumpy Burgertushie »

in your admin panel, check server settings. if you have "force" set to yes, set it to no. If it is set to no, set it to yes.

purge cache, delete board cookies and test.

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
biosek
Registered User
Posts: 16
Joined: Sat Jan 31, 2015 2:57 pm

Re: htaccess or something messes up URL

Post by biosek »

Ok, was at NO, changed to YES. Didnt help.
I then tried to delete forum's path (in server settings), then huray it worked. No /domains/example.com,

BUT I cant login into acp... :D Everytime when I successfully login, click ACP, fill password, click login, it automatically logs me out...

Any other directions which I could take?
User avatar
Lumpy Burgertushie
Registered User
Posts: 68587
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: htaccess or something messes up URL

Post by Lumpy Burgertushie »

check your cookie settings.

cookie domain should be: .domain.com or , if using a subdomain: .subdomain.domain.com

cookie path should be : /

do that and then change the cookie name and purge the cache and test,.

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
biosek
Registered User
Posts: 16
Joined: Sat Jan 31, 2015 2:57 pm

Re: htaccess or something messes up URL

Post by biosek »

Ok I dont know exactly what helped.
But my settings now:

Board settings:
Main website URL=>http://domain.com

Cookie settings:
Cookie domain=>domain.com
Cookie path=>/

Server settings:
Enable URL Rewriting=>Yes
Force server URL settings=>Yes
Server protocol=>http://
Domain name=>domain.cz
Script path=>nothing

Security settings:
Session IP validation=>A.B.C
Validate browser=>No
Validate X_FORWARDED_FOR header=>No
Validate Referrer=>None

And the problem with URL changes are gone.
Thank you for your time, dunno what change helped.
Writing my expirience just for future reference.
If you are locking these topics. I think you can lock this. :)
User avatar
Mick
Support Team Member
Support Team Member
Posts: 23458
Joined: Fri Aug 29, 2008 9:49 am

Re: htaccess or something messes up URL

Post by Mick »

Under normal circumstances we don't lock topics but mark them solved Image, done anyway.
"The more connected we get the more alone we become" - Kyle Broflovski©
biosek
Registered User
Posts: 16
Joined: Sat Jan 31, 2015 2:57 pm

Re: htaccess or something messes up URL

Post by biosek »

Well I was a little ahead of myself.

The standard functionaly of the forum works fine.
But Custom added pages through Pages extension still have their links like as i described.
e.g. domain.com/domains/domain.com/page/test-page1

Is this the problem of the app.php that is rewritten through mode_rewrite or is this problem of the extensions?

Edit:
To be exact. This does not happens, when I am at http://domain.com,
but when I am at http://domain.com/index.php or any other *.php (memberlist.php, viewtopic.php, etc)

Also It seems not to be problem only for Pages extension, but for Rules extension as well.
Last edited by biosek on Mon Mar 09, 2015 10:17 pm, edited 1 time in total.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 23458
Joined: Fri Aug 29, 2008 9:49 am

Re: htaccess or something messes up URL

Post by Mick »

If things work as expected without the extension(s) then the conclusion is there may be an issue with the extension(s) You should ask the author of pages or any other extension you believe to be the problem.
"The more connected we get the more alone we become" - Kyle Broflovski©
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5444
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman

Re: htaccess or something messes up URL

Post by MattF »

biosek wrote:Well I was a little ahead of myself.

The standard functionaly of the forum works fine.
But Custom added pages through Pages extension still have their links like as i described.
e.g. domain.com/domains/domain.com/page/test-page1

Is this the problem of the app.php that is rewritten through mode_rewrite or is this problem of the extensions?

Edit:
To be exact. This does not happens, when I am at http://domain.com,
but when I am at http://domain.com/index.php or any other *.php (memberlist.php, viewtopic.php, etc)

Also It seems not to be problem only for Pages extension, but for Rules extension as well.
Standard forum functionality works fine, because none of phpBB uses the routing/controller system yet.

Extensions do. Pages and all other extensions that use front controllers and need to generate links to them do not create these links themselves. The phpBB framework does via phpBB/symfony's routing system.

Any problems reported here are with the phpBB framework and your server configuration...not with the extensions. Perhaps a bug ticket is needed?

You will experience your issue with every extension that uses front controllers/routing, as well as the core phpBB pages currently being moved to controllers in 3.2.x (such as the FAQ).
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
biosek
Registered User
Posts: 16
Joined: Sat Jan 31, 2015 2:57 pm

Re: htaccess or something messes up URL

Post by biosek »

I didnt find any suitable ticket, so I created new https://tracker.phpbb.com/browse/PHPBB3-13683
Locked

Return to “[3.1.x] Support Forum”