View previous topic :: View next topic |
Author |
Message |
frix n00b
Joined: 02 Feb 2006 Posts: 8 Location: Sweden
|
Posted: Mon Mar 27, 2006 12:01 pm Post subject: Yet another mod_rewrite question (sigh!) [kind of solved] |
|
|
I've been googling and wading through numerous posts/forums/whatever without getting closer to a solution so I'm asking for your collective wisdom...
What I'm trying to do is to move the web root from the standard 'htdocs' to a directory on the same level, called 'web2'.
'htdocs' contains just a few static html files, while 'web2' contains a brand new site based on Joomla. I've tried several different
setups using mod_rewrite rules but, needless to say, I've not been able to get it work. So if there's a kind soul out there who can point me in the right direction I would be more than grateful.
directory structure:
/var/www/localhost
| htdocs
| web2
| cgi-bin
| error
| icons
To be able to test 'web2' during the development, I put a symlink in 'htdocs' called 'web2' which points to ../web2
I know that the 'mod_rewrite' is working, since I've turned on logging for it, it's just that I don't seem to be able to figure out the correct rule for it.
Thnx in advance!
Last edited by frix on Mon Mar 27, 2006 5:15 pm; edited 1 time in total |
|
Back to top |
|
|
minskpower Tux's lil' helper
Joined: 16 Jun 2005 Posts: 94 Location: /dev/null
|
Posted: Mon Mar 27, 2006 4:01 pm Post subject: |
|
|
But why mod_rewrite?
Why not change the DocumentRoot if you want to move the default root?
mod_rewrite would make sense if you had web2 inside htdocs but this setup of yours is confusing |
|
Back to top |
|
|
frix n00b
Joined: 02 Feb 2006 Posts: 8 Location: Sweden
|
Posted: Mon Mar 27, 2006 5:12 pm Post subject: |
|
|
Mmm... I kind of solved it, but in a less satisfying way. You see, 'web2' contains a Joomla-webpublishing system and it has loads of references to 'web2'.
Changing just the document root worked for the frontpage (even though it didn't looked quite right...) but none of the links worked, as they referenced 'web2'. But adding a symlink called 'web2' inside that directory, pointing to the very same directory, seems to have solved it for now. Even though 'web2' is displayed every now and then in the address field of the browser. It would be nice to get rid of that, but I guess I can live with it... |
|
Back to top |
|
|
minskpower Tux's lil' helper
Joined: 16 Jun 2005 Posts: 94 Location: /dev/null
|
Posted: Mon Mar 27, 2006 6:09 pm Post subject: |
|
|
Aaah, hardcoded link paths, how nice
You could do a mass replace I guess, but otherwise I think this is going to haunt you.. |
|
Back to top |
|
|
frix n00b
Joined: 02 Feb 2006 Posts: 8 Location: Sweden
|
Posted: Mon Mar 27, 2006 7:39 pm Post subject: |
|
|
Mass replace? Umm... don't think so...
Joomla! is database driven and consists of 80 different tables.
Most of the information is stored in the database, and it's probably not very
wise to poke around in there... |
|
Back to top |
|
|
markandrew Apprentice
Joined: 04 Feb 2004 Posts: 176 Location: Manchester, UK
|
Posted: Tue Mar 28, 2006 3:00 pm Post subject: |
|
|
it sounds like your new (joomla) site has been misconfigured - to expect document root at /var/www, which i'm guessing isn't what you want
try:
Alias /web2/ /var/www/web2
DocumentRoot /var/www/web2
or:
DocumentRoot /var/www/web2
RewriteRule ^/web2/(.*) /$1 [QSA]
but to be honest, I'd be looking at reconfiguring the joomla site to use /var/www/web2 as the webroot, anything else is a bit of a hack - you might get recursive nastiness trying to work round it with the above |
|
Back to top |
|
|
frix n00b
Joined: 02 Feb 2006 Posts: 8 Location: Sweden
|
Posted: Wed Mar 29, 2006 6:45 pm Post subject: |
|
|
Actually, it seems to work ok now. I know it's probably not right way to do it, but this was the least complicated way...
All I did was to set the DocumentRoot to /var/www/localhost/web2 (instead of /var/www/localhost/htdocs) and in the
new web root, added a symlink with 'ln -s . web2'. It doesn't feel broken, even the webshop module works ok, and the
only drawback is that the URL displays 'web2'. But I'll take a look at your suggestions, thanks anyway! |
|
Back to top |
|
|
|