Pretty Trac URLs - how are the page and cookie URLs properly set?

10 views
Skip to first unread message

Carsten Fuchs

unread,
Jan 2, 2010, 8:25:35 AM1/2/10
to trac-...@googlegroups.com
Dear Trac group,

I have a Trac instance running at

http://web278.server07.lcube-server.de/trac-cafu/htdocs/

and a .htaccess file according to http://trac.edgewall.org/wiki/TracPrettyUrls at the root
directory http://web278.server07.lcube-server.de/ :

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ trac-cafu/htdocs/trac.fcgi/$1 [L,QSA]
RewriteRule ^$ trac-cafu/htdocs/trac.fcgi [L]


This works as expected, for example
http://web278.server07.lcube-server.de/about
is internally rewritten to
http://web278.server07.lcube-server.de/trac-cafu/htdocs/trac.fcgi/about

However - and here is the problem - the cookie and the URLs in the website all contain the
unwanted "trac-cafu/htdocs/trac.fcgi/" part. The above Wiki page doesn't mention anything on how
this could be fixed.

Despite a search of the Wiki and mailing-list, I've not been able to find the proper place where
this part of the cookie and page URLs can be set - any help would much be welcome!

Thank you very much,
and best regards,
Carsten


--
Cafu - the open-source Game and Graphics Engine
for multiplayer, cross-platform, real-time 3D Action
Learn more at www.cafu.de

Carsten Fuchs

unread,
Jan 4, 2010, 9:24:21 AM1/4/10
to trac-...@googlegroups.com
Am 02.01.2010 14:25, schrieb Carsten Fuchs:
> However - and here is the problem - the cookie and the URLs in the
> website all contain the unwanted "trac-cafu/htdocs/trac.fcgi/" part. The
> above Wiki page doesn't mention anything on how this could be fixed.


I've been updating the URLs, the Trac instance is now available at

http://trac.cafu.de

and the .htaccess file at that location is:


# Quelle: http://trac.edgewall.org/wiki/TracPrettyUrls
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ trac.fcgi/$1 [QSA,L]

# RewriteRule ^$ trac.fcgi [L]


While the rewriting itself continues to work, the core problem remains:
The "trac.fcgi" part of the URL is generated in all page links.

I've been able to find some related websites and tickets:
http://natmaster.com/articles/installing_trac_0.10.php
http://trac.edgewall.org/ticket/2299
http://trac.edgewall.org/ticket/8328
but no matter what I try, the script name continues to appear in the page links.
I've tried to override os.environ['SCRIPT_PATH'], os.environ['SCRIPT_URL'] and a few more in
trac.fcgi, but to no avail.

Any ideas?

Best regards,

Olemis Lang

unread,
Jan 4, 2010, 9:59:03 AM1/4/10
to trac-...@googlegroups.com
On Mon, Jan 4, 2010 at 9:24 AM, Carsten Fuchs <Carste...@t-online.de> wrote:
> Am 02.01.2010 14:25, schrieb Carsten Fuchs:
>> However - and here is the problem - the cookie and the URLs in the
>> website all contain the unwanted "trac-cafu/htdocs/trac.fcgi/" part. The
>> above Wiki page doesn't mention anything on how this could be fixed.
>
> I've been updating the URLs, the Trac instance is now available at
>
>        http://trac.cafu.de
>
[...]

>
> While the rewriting itself continues to work, the core problem remains:
> The "trac.fcgi" part of the URL is generated in all page links.
>
[...]
>
> Any ideas?
>

Perhaps there is an option in trac.ini [project] that allows you to
set the base URL of the environment ... ?

> --
>   Cafu - the open-source Game and Graphics Engine
> for multiplayer, cross-platform, real-time 3D Action
>              Learn more at www.cafu.de
>

Wow !

--
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Free new ripit 1.3.3 Download - mac software -
http://feedproxy.google.com/~r/TracGViz-full/~3/KFwyUTKH0vI/

Carsten Fuchs

unread,
Jan 4, 2010, 10:14:36 AM1/4/10
to trac-...@googlegroups.com
Am 04.01.2010 15:59, schrieb Olemis Lang:
> Perhaps there is an option in trac.ini [project] that allows you to
> set the base URL of the environment ... ?

Well, here is the relevant excerpt from my (unmodified) trac.ini:


[project]
admin_trac_url = .
url = http://trac.cafu.de

[trac]
base_url = http://trac.cafu.de

(The documenation at <http://trac.edgewall.org/wiki/TracIni> doesn't seem to suggest that the
script name is related to these settings...(?))

Best regards,
Carsten

Olemis Lang

unread,
Jan 4, 2010, 10:25:22 AM1/4/10
to trac-...@googlegroups.com
On Mon, Jan 4, 2010 at 10:14 AM, Carsten Fuchs <Carste...@t-online.de> wrote:
> Am 04.01.2010 15:59, schrieb Olemis Lang:
>>
>> Perhaps there is an option in trac.ini [project] that allows you to
>> set the base URL of the environment ... ?
>
> Well, here is the relevant excerpt from my (unmodified) trac.ini:
>
[...]

>
> (The documenation at <http://trac.edgewall.org/wiki/TracIni> doesn't seem to
> suggest that the script name is related to these settings...(?))
>

Ooops ! ... then I don't know ...

Tsoots

unread,
Jan 18, 2010, 11:27:54 AM1/18/10
to Trac Users
Hello Carsten,

Looks like you managed to solve this problem. I don't see trac.fcgi
entries in your URLs at http://trac.cafu.de/
Could you please tell us what did you do to achieve this? I am
currently facing the exactly same issue with my Trac setup.

Thanks

Carsten Fuchs

unread,
Jan 18, 2010, 1:50:46 PM1/18/10
to trac-...@googlegroups.com
Hi,

See
<http://groups.google.com/group/trac-dev/t/861fad676393bfbf>
and the links mentioned there, especially
<http://trac.edgewall.org/ticket/2299>

My hoster was so kind as to make the appropriate settings in the global httpd.conf, which solved the
problem for me. I never got the purely .htaccess based solution to work, leaving ticket 2299 open.

Reply all
Reply to author
Forward
0 new messages