Server issue Friendly url not working (base tag issues)

Mike

XenForo developer
Staff member
#7
I've attached a test script. You will likely need to rename it to index.php to really test it as it only happens in one situation (the / rather than /index.php). You'll have to rename the existing index.php, obviously.

With the test.php version of index.php in place, access <url>/ and <url>/index.php and provide the output here please. :)
 

Attachments

Andy.N

Well-known member
#8
I've attached a test script. You will likely need to rename it to index.php to really test it as it only happens in one situation (the / rather than /index.php). You'll have to rename the existing index.php, obviously.

With the test.php version of index.php in place, access <url>/ and <url>/index.php and provide the output here please. :)
Thanks for the script. Here is my output
<url>/index.php
Base URL: /~quantnet/forum/index.php
Base Path: /~quantnet/forum
Path Info:
Request URI: /~quantnet/forum/index.php
array(6) { ["basePath"] => string(17) "/~quantnet/forum/"
["host"] => string(14) "98.158.182.140"
["protocol"] => string(4) "http"
["fullBasePath"] => string(38) "http://98.158.182.140/~quantnet/forum/"
["requestUri"] => string(26) "/~quantnet/forum/index.php"
["fullUri"] => string(47) "http://98.158.182.140/~quantnet/forum/index.php" }

Here is output
<url>/
Base URL:
Base Path:
Path Info: /~quantnet/forum/
Request URI: /~quantnet/forum/
array(6) { ["basePath"] => string(1) "/"
["host"] => string(14) "98.158.182.140"
["protocol"] => string(4) "http"
["fullBasePath"] => string(22) "http://98.158.182.140/"
["requestUri"] => string(17) "/~quantnet/forum/"
["fullUri"] => string(38) "http://98.158.182.140/~quantnet/forum/" }
 

Mike

XenForo developer
Staff member
#10
Ahh actually this is probably where RewriteBase is needed. What happens if you put this in the .htaccess file, after the "RewriteEngine On" line:

RewriteBase /~quantnet/forum/
 

Andy.N

Well-known member
#12
Ahh actually this is probably where RewriteBase is needed. What happens if you put this in the .htaccess file, after the "RewriteEngine On" line:

RewriteBase /~quantnet/forum/
Mike,

It's a no go

Here is my .htaccess content in the /forum folder

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~quantnet/forum/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data|js|styles|install) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>
 

boban

Well-known member
#18
I have two copies of xf installed on the same machine, same web server (Apache version 2.2.3 )
One is on IP address and another one on domain name (second IP address).
No problem with SEO on domain name but no luck on the other one :)


SEO http://www.beke.co.nz/xforum/forums/objave.6/ OK
http://www.beke.co.nz/xforum/index.php?forums/objave.6/ OK


http://206.123.115.165/xforum/index.php?forums/objave.6/ OK
SEO http://206.123.115.165/xforum/forums/objave.6/ Not Found


htaccess is same:

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data|js|styles|install) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>



test.php

IP address



<url>/index.php

Base URL: /xforum/index.php
Base Path: /xforum
Path Info:
Request URI: /xforum/index.php

array(6) {
["basePath"] => string(8) "/xforum/"
["host"] => string(15) "206.123.115.165"
["protocol"] => string(4) "http"
["fullBasePath"] => string(30) "http://206.123.115.165/xforum/"
["requestUri"] => string(17) "/xforum/index.php"
["fullUri"] => string(39) "http://206.123.115.165/xforum/index.php"
}

<url>/
Base URL: /xforum
Base Path: /xforum
Path Info: /
Request URI: /xforum/

array(6) {
["basePath"] => string(8) "/xforum/"
["host"] => string(15) "206.123.115.165"
["protocol"] => string(4) "http"
["fullBasePath"] => string(30) "http://206.123.115.165/xforum/"
["requestUri"] => string(8) "/xforum/"
["fullUri"] => string(30) "http://206.123.115.165/xforum/"
}


Domain name

<url>/index.php

Base URL: /xforum/index.php
Base Path: /xforum
Path Info:
Request URI: /xforum/index.php

array(6) {
["basePath"] => string(8) "/xforum/"
["host"] => string(14) "www.beke.co.nz"
["protocol"] => string(4) "http"
["fullBasePath"] => string(29) "http://www.beke.co.nz/xforum/"
["requestUri"] => string(17) "/xforum/index.php"
["fullUri"] => string(38) "http://www.beke.co.nz/xforum/index.php"
}

<url>/

Base URL: /xforum
Base Path: /xforum
Path Info: /
Request URI: /xforum/

array(6) {
["basePath"] => string(8) "/xforum/"
["host"] => string(14) "www.beke.co.nz"
["protocol"] => string(4) "http"
["fullBasePath"] => string(29) "http://www.beke.co.nz/xforum/"
["requestUri"] => string(8) "/xforum/"
["fullUri"] => string(29) "http://www.beke.co.nz/xforum/"
}
 

boban

Well-known member
#19
I have solved my problem. It has nothing to do with Xenforo, the Apache virtual server was misconfigured. :oops: I'm sorry if I wasted your time.

The following directives are added to the Apache virtual host configuration file:
Code:
<Directory "/my/directory">
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
 

Forsaken

Well-known member
#20
I'm also running Litespeed, but I'm not having this issue at all...

I'll ask my host if I can get a copy of his config if you want it.
 
Top