I'm puzzling through a few things at once and starting to hit walls on this one as well.
I've got drupal set up in a subdirectory of a larger site. That larger site is in subversion and I run a staging site and a few local incarnations of it, which means that the site's domain name changes periodically, from "staging.example.com" to "example.local" or "www.example.com"
Right now, I've got the site's overall primary links in drupal as primary links, and I'd like to keep them there, but drupal is gobbling up the absolute paths even though they're absolute:
I gave the menu path as
"/news/" and drupal points to
"http://staging.example.com/drupal//news/" when I'm aiming for
"http://staging.example.com/news"
I spent a lot of time monkeying with clean URLs on the theory that they'd fix this, only to discover ... nope.
I've looked around for a themeable function that would let me wrestle links into being relative to the site as a whole, not relative to drupal, but I'm not seeing it.
This doesn't appear to be controlled by "theme_menu_links" http://api.drupal.org/api/function/theme_menu_links/5
Any suggestions?
Thanks, Amanda
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I'm still working on this, though I suspect from my reading that the real solution lies in .htaccess rewrite rules.
I thought this:
RewriteRule ^/drupal//(.*) /$1 [L]
Would work -- take paths that have the double slash and bump them up a level to the root of the site -- but it doesn't seem to be taking. For bonus fun I tried quirky variations like ...
RewriteRule ^/drupal//(.*) /drupal/foo/$1 [L]
And didn't get anywhere either. Am I even making sense here?
Thanks, amanda
(http://drupal.org/node/187647)
Amanda B Hickman wrote:
I'm puzzling through a few things at once and starting to hit walls on this one as well.
I've got drupal set up in a subdirectory of a larger site. That larger site is in subversion and I run a staging site and a few local incarnations of it, which means that the site's domain name changes periodically, from "staging.example.com" to "example.local" or "www.example.com"
Right now, I've got the site's overall primary links in drupal as primary links, and I'd like to keep them there, but drupal is gobbling up the absolute paths even though they're absolute:
I gave the menu path as
"/news/" and drupal points to
"http://staging.example.com/drupal//news/" when I'm aiming for
"http://staging.example.com/news"
I spent a lot of time monkeying with clean URLs on the theory that they'd fix this, only to discover ... nope.
I've looked around for a themeable function that would let me wrestle links into being relative to the site as a whole, not relative to drupal, but I'm not seeing it.
This doesn't appear to be controlled by "theme_menu_links" http://api.drupal.org/api/function/theme_menu_links/5
Any suggestions?
Thanks, Amanda
- -- Amanda, Bee http://velociraptor.info/notes
Generally, if you access your Drupal site as http://www.example.com/drupal/ then that's your site's web root.
If you use a fully qualified URL in a menu to take you to http://www.example.com/news that will take you outside Drupal, unless you have set up a Drupal site for http://www.example.com.
I am not sure I completely understand what you are trying to achieve and what you are running in your http://www.example.com site, but the usual method of using multiple domain names is to point all domain names to Drupal's installation directory and set up respective settings.php files for the different domains to use the same database ($db_url).
Consider - setting up Drupal sites for all the domains or subdomains you want (see http://drupal.org/node/147828), - don't set up a Drupal site for http://www.example.com/drupal/, - and use your .htaccess file to make Drupal leave alone certain paths of your other application (http://drupal.org/node/30334).
There was a discussion about using some .htaccess tricks (http://drupal.org/node/144643) but I wouldn't go there before trying all the standard methods. This kind of .htaccess tricks tend to make a setup fragile.
On 10/30/07, Amanda Bee amanda@velociraptor.info wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I'm still working on this, though I suspect from my reading that the real solution lies in .htaccess rewrite rules.
I thought this:
RewriteRule ^/drupal//(.*) /$1 [L]
Would work -- take paths that have the double slash and bump them up a level to the root of the site -- but it doesn't seem to be taking. For bonus fun I tried quirky variations like ...
RewriteRule ^/drupal//(.*) /drupal/foo/$1 [L]
And didn't get anywhere either. Am I even making sense here?
Thanks, amanda
(http://drupal.org/node/187647)
Amanda B Hickman wrote:
I'm puzzling through a few things at once and starting to hit walls on this one as well.
I've got drupal set up in a subdirectory of a larger site. That larger site is in subversion and I run a staging site and a few local incarnations of it, which means that the site's domain name changes periodically, from "staging.example.com" to "example.local" or "www.example.com"
Right now, I've got the site's overall primary links in drupal as primary links, and I'd like to keep them there, but drupal is gobbling up the absolute paths even though they're absolute:
I gave the menu path as
"/news/" and drupal points to
"http://staging.example.com/drupal//news/" when I'm aiming for
"http://staging.example.com/news"
I spent a lot of time monkeying with clean URLs on the theory that they'd fix this, only to discover ... nope.
I've looked around for a themeable function that would let me wrestle links into being relative to the site as a whole, not relative to drupal, but I'm not seeing it.
This doesn't appear to be controlled by "theme_menu_links" http://api.drupal.org/api/function/theme_menu_links/5
Any suggestions?
Thanks, Amanda
Amanda, Bee http://velociraptor.info/notes -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHJ0hqrxDTsWdh5zkRAs1CAJ4o5oKatPouGK8eGYMYBTwXCU2/1wCeJSLq ELfsiEBi/mYj4MucEHcdwrc= =p8ax
-----END PGP SIGNATURE-----
[ Drupal support list | http://lists.drupal.org/ ]
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Thanks for taking a stab at it. Here are some responses that I hope will clarify my troubles a wee bit ...
Cog Rusty wrote:
Generally, if you access your Drupal site as http://www.example.com/drupal/ then that's your site's web root.
Right, that is my drupal site's root.
If you use a fully qualified URL in a menu to take you to http://www.example.com/news that will take you outside Drupal, unless you have set up a Drupal site for http://www.example.com.
Right: a fully qualified URL will do that, but I'd have to include the domain name (http://www.example.com). The site is moving around, however, and the domain name could be any of ...
http://www.example.com http://staging.example.com http://example.local
And I want to be able to test out the menus and other changes on a staging site before I push the drupal section live.
I am not sure I completely understand what you are trying to achieve and what you are running in your http://www.example.com site, but the
The rest of the site uses a frightening home-brewed content management system developed over many years by many programmers. I'm in the process of streamlining that, but first I'd like to get a few things into drupal and working well (our forums, for one thing).
usual method of using multiple domain names is to point all domain names to Drupal's installation directory and set up respective settings.php files for the different domains to use the same database ($db_url).
Drupal works fine under each of these domain names, and the separate settings.php files in sites/example.local and sites/staging.example.com do a fine job of pointing it off to different databases depending on where I'm accessing it from. That part works fine.
Consider
- setting up Drupal sites for all the domains or subdomains you want
(see http://drupal.org/node/147828),
- don't set up a Drupal site for http://www.example.com/drupal/,
- and use your .htaccess file to make Drupal leave alone certain paths
of your other application (http://drupal.org/node/30334).
There was a discussion about using some .htaccess tricks (http://drupal.org/node/144643) but I wouldn't go there before trying all the standard methods. This kind of .htaccess tricks tend to make a setup fragile.
I'm not dying to go the .htaccess route, I promise, but I can't figure out how to persuade drupal that a path in the menu like "/news/" is relative to the whole site, not relative to drupal.
On 10/30/07, Amanda Bee amanda@velociraptor.info wrote: I'm still working on this, though I suspect from my reading that the real solution lies in .htaccess rewrite rules.
I thought this:
RewriteRule ^/drupal//(.*) /$1 [L]
Would work -- take paths that have the double slash and bump them up a level to the root of the site -- but it doesn't seem to be taking. For bonus fun I tried quirky variations like ...
RewriteRule ^/drupal//(.*) /drupal/foo/$1 [L]
And didn't get anywhere either. Am I even making sense here?
Thanks, amanda
(http://drupal.org/node/187647)
Amanda B Hickman wrote:
I'm puzzling through a few things at once and starting to hit walls on this one as well.
I've got drupal set up in a subdirectory of a larger site. That larger site is in subversion and I run a staging site and a few local incarnations of it, which means that the site's domain name changes periodically, from "staging.example.com" to "example.local" or "www.example.com"
Right now, I've got the site's overall primary links in drupal as primary links, and I'd like to keep them there, but drupal is gobbling up the absolute paths even though they're absolute:
I gave the menu path as
"/news/" and drupal points to
"http://staging.example.com/drupal//news/" when I'm aiming for
"http://staging.example.com/news"
I spent a lot of time monkeying with clean URLs on the theory that they'd fix this, only to discover ... nope.
I've looked around for a themeable function that would let me wrestle links into being relative to the site as a whole, not relative to drupal, but I'm not seeing it.
This doesn't appear to be controlled by "theme_menu_links" http://api.drupal.org/api/function/theme_menu_links/5
Any suggestions?
Thanks, Amanda
- -- [ Drupal support list | http://lists.drupal.org/ ]
- -- Amanda B Hickman (p) 917 655 2579 (s) amandabee (a) amandahlinc (w) http://velociraptor.info
Quoting Amanda B Hickman amanda@velociraptor.info:
I'm not dying to go the .htaccess route, I promise, but I can't figure out how to persuade drupal that a path in the menu like "/news/" is relative to the whole site, not relative to drupal.
Try path aliasing, e.g. follows:
<code file="/etc/httpd/conf.d/mydomain.conf"> <VirtualHost *> DocumentRoot "e:\var\www\mydomain" ServerName www.example.com ServerAlias example Alias /drupal e:\var\www\drupal-5.2 Alias /bin e:\var\www\bin Alias /sqladmin e:\var\www\phpMyAdmin-2.6.1 </VirtualHost> </code>
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Earnie Boyd wrote:
Quoting Amanda B Hickman amanda@velociraptor.info:
I'm not dying to go the .htaccess route, I promise, but I can't figure out how to persuade drupal that a path in the menu like "/news/" is relative to the whole site, not relative to drupal.
Try path aliasing, e.g. follows:
<code file="/etc/httpd/conf.d/mydomain.conf"> <VirtualHost *> DocumentRoot "e:\var\www\mydomain" ServerName www.example.com ServerAlias example Alias /drupal e:\var\www\drupal-5.2 Alias /bin e:\var\www\bin Alias /sqladmin e:\var\www\phpMyAdmin-2.6.1 </VirtualHost> </code>
I think this means that I would have to define an Alias for anything I want to link to from within Drupal's menus system that lives outside of my Drupal installation, right?
That kind of defeats the point.
I think that
RewriteRule ^/drupal//(.*) /$1 [L]
Should fundamentally work: for any path that links to /drupal// assume that drupal is taking over where it shouldn't and pull the /drupal/ part. Leave the /.
It doesn't, though.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
- -- Amanda, Bee http://velociraptor.info/notes
Quoting Amanda Bee amanda@velociraptor.info:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Earnie Boyd wrote:
Quoting Amanda B Hickman amanda@velociraptor.info:
I'm not dying to go the .htaccess route, I promise, but I can't figure out how to persuade drupal that a path in the menu like "/news/" is relative to the whole site, not relative to drupal.
Try path aliasing, e.g. follows:
<code file="/etc/httpd/conf.d/mydomain.conf"> <VirtualHost *> DocumentRoot "e:\var\www\mydomain" ServerName www.example.com ServerAlias example Alias /drupal e:\var\www\drupal-5.2 Alias /bin e:\var\www\bin Alias /sqladmin e:\var\www\phpMyAdmin-2.6.1 </VirtualHost> </code>
I think this means that I would have to define an Alias for anything I want to link to from within Drupal's menus system that lives outside of my Drupal installation, right?
That kind of defeats the point.
And as I've discovered doesn't do what you want from the menu code. However if you create a block and fill the body with the likes of ``<a href="/news/">News</a><br/>'' it behaves nicely. Be sure give the block a nice title and you'll need to activate it once you create it.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
On 10/31/07, Amanda B Hickman amanda@velociraptor.info wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Thanks for taking a stab at it. Here are some responses that I hope will clarify my troubles a wee bit ...
Cog Rusty wrote:
Generally, if you access your Drupal site as http://www.example.com/drupal/ then that's your site's web root.
Right, that is my drupal site's root.
If you use a fully qualified URL in a menu to take you to http://www.example.com/news that will take you outside Drupal, unless you have set up a Drupal site for http://www.example.com.
Right: a fully qualified URL will do that, but I'd have to include the domain name (http://www.example.com). The site is moving around, however, and the domain name could be any of ...
http://www.example.com http://staging.example.com http://example.local
And I want to be able to test out the menus and other changes on a staging site before I push the drupal section live.
I still don't understand. You want that menu link to change, based on what? If you are in a http://www.example.com/drupal site, how could the menu link switch to any other domain? Based on what?
If you manage to use an apache rewrite, what condition is that going to check for changing domain?
I don't see any other way except depending on the domain of the Drupal site that you are currently in.
I am not sure I completely understand what you are trying to achieve and what you are running in your http://www.example.com site, but the
The rest of the site uses a frightening home-brewed content management system developed over many years by many programmers. I'm in the process of streamlining that, but first I'd like to get a few things into drupal and working well (our forums, for one thing).
usual method of using multiple domain names is to point all domain names to Drupal's installation directory and set up respective settings.php files for the different domains to use the same database ($db_url).
Drupal works fine under each of these domain names, and the separate settings.php files in sites/example.local and sites/staging.example.com do a fine job of pointing it off to different databases depending on where I'm accessing it from. That part works fine.
Consider
- setting up Drupal sites for all the domains or subdomains you want
(see http://drupal.org/node/147828),
- don't set up a Drupal site for http://www.example.com/drupal/,
- and use your .htaccess file to make Drupal leave alone certain paths
of your other application (http://drupal.org/node/30334).
There was a discussion about using some .htaccess tricks (http://drupal.org/node/144643) but I wouldn't go there before trying all the standard methods. This kind of .htaccess tricks tend to make a setup fragile.
I'm not dying to go the .htaccess route, I promise, but I can't figure out how to persuade drupal that a path in the menu like "/news/" is relative to the whole site, not relative to drupal.
On 10/30/07, Amanda Bee amanda@velociraptor.info wrote: I'm still working on this, though I suspect from my reading that the real solution lies in .htaccess rewrite rules.
I thought this:
RewriteRule ^/drupal//(.*) /$1 [L]
Would work -- take paths that have the double slash and bump them up a level to the root of the site -- but it doesn't seem to be taking. For bonus fun I tried quirky variations like ...
RewriteRule ^/drupal//(.*) /drupal/foo/$1 [L]
And didn't get anywhere either. Am I even making sense here?
Thanks, amanda
(http://drupal.org/node/187647)
Amanda B Hickman wrote:
I'm puzzling through a few things at once and starting to hit walls on this one as well.
I've got drupal set up in a subdirectory of a larger site. That larger site is in subversion and I run a staging site and a few local incarnations of it, which means that the site's domain name changes periodically, from "staging.example.com" to "example.local" or "www.example.com"
Right now, I've got the site's overall primary links in drupal as primary links, and I'd like to keep them there, but drupal is gobbling up the absolute paths even though they're absolute:
I gave the menu path as
"/news/" and drupal points to
"http://staging.example.com/drupal//news/" when I'm aiming for
"http://staging.example.com/news"
I spent a lot of time monkeying with clean URLs on the theory that they'd fix this, only to discover ... nope.
I've looked around for a themeable function that would let me wrestle links into being relative to the site as a whole, not relative to drupal, but I'm not seeing it.
This doesn't appear to be controlled by "theme_menu_links" http://api.drupal.org/api/function/theme_menu_links/5
Any suggestions?
Thanks, Amanda
[ Drupal support list | http://lists.drupal.org/ ]
Amanda B Hickman (p) 917 655 2579 (s) amandabee (a) amandahlinc (w) http://velociraptor.info -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHJ6nmrxDTsWdh5zkRAvrqAJ4ytwZ1agEWPwMBvXE9Dai6UJlIQgCaA+ZA /aGt3qtn1ycR4megS5I9FQc= =A3hC
-----END PGP SIGNATURE-----
[ Drupal support list | http://lists.drupal.org/ ]
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I don't want drupal to do anything. If I set the path to "/news/" I want drupal to make a link that says <a href="/news/">Foo</a> and not <a href="/drupal//news/">Foo</a>.
This is obviously some kind of rocket science like I never imagined.
Cog Rusty wrote:
On 10/31/07, Amanda B Hickman amanda@velociraptor.info wrote: Thanks for taking a stab at it. Here are some responses that I hope will clarify my troubles a wee bit ...
Cog Rusty wrote:
Generally, if you access your Drupal site as http://www.example.com/drupal/ then that's your site's web root.
Right, that is my drupal site's root.
If you use a fully qualified URL in a menu to take you to http://www.example.com/news that will take you outside Drupal, unless you have set up a Drupal site for http://www.example.com.
Right: a fully qualified URL will do that, but I'd have to include the domain name (http://www.example.com). The site is moving around, however, and the domain name could be any of ...
http://www.example.com http://staging.example.com http://example.local
And I want to be able to test out the menus and other changes on a staging site before I push the drupal section live.
I still don't understand. You want that menu link to change, based on what? If you are in a http://www.example.com/drupal site, how could the menu link switch to any other domain? Based on what?
If you manage to use an apache rewrite, what condition is that going to check for changing domain?
I don't see any other way except depending on the domain of the Drupal site that you are currently in.
I am not sure I completely understand what you are trying to achieve and what you are running in your http://www.example.com site, but the
The rest of the site uses a frightening home-brewed content management system developed over many years by many programmers. I'm in the process of streamlining that, but first I'd like to get a few things into drupal and working well (our forums, for one thing).
usual method of using multiple domain names is to point all domain names to Drupal's installation directory and set up respective settings.php files for the different domains to use the same database ($db_url).
Drupal works fine under each of these domain names, and the separate settings.php files in sites/example.local and sites/staging.example.com do a fine job of pointing it off to different databases depending on where I'm accessing it from. That part works fine.
Consider
- setting up Drupal sites for all the domains or subdomains you want
(see http://drupal.org/node/147828),
- don't set up a Drupal site for http://www.example.com/drupal/,
- and use your .htaccess file to make Drupal leave alone certain paths
of your other application (http://drupal.org/node/30334).
There was a discussion about using some .htaccess tricks (http://drupal.org/node/144643) but I wouldn't go there before trying all the standard methods. This kind of .htaccess tricks tend to make a setup fragile.
I'm not dying to go the .htaccess route, I promise, but I can't figure out how to persuade drupal that a path in the menu like "/news/" is relative to the whole site, not relative to drupal.
On 10/30/07, Amanda Bee amanda@velociraptor.info wrote: I'm still working on this, though I suspect from my reading that the real solution lies in .htaccess rewrite rules.
I thought this:
RewriteRule ^/drupal//(.*) /$1 [L]
Would work -- take paths that have the double slash and bump them up a level to the root of the site -- but it doesn't seem to be taking. For bonus fun I tried quirky variations like ...
RewriteRule ^/drupal//(.*) /drupal/foo/$1 [L]
And didn't get anywhere either. Am I even making sense here?
Thanks, amanda
(http://drupal.org/node/187647)
Amanda B Hickman wrote:
> I'm puzzling through a few things at once and starting to hit walls on > this one as well. > > I've got drupal set up in a subdirectory of a larger site. That larger > site is in subversion and I run a staging site and a few local > incarnations of it, which means that the site's domain name changes > periodically, from "staging.example.com" to "example.local" or > "www.example.com" > > Right now, I've got the site's overall primary links in drupal as > primary links, and I'd like to keep them there, but drupal is gobbling > up the absolute paths even though they're absolute: > > I gave the menu path as > > "/news/" and drupal points to > > "http://staging.example.com/drupal//news/" when I'm aiming for > > "http://staging.example.com/news" > > I spent a lot of time monkeying with clean URLs on the theory that > they'd fix this, only to discover ... nope. > > I've looked around for a themeable function that would let me wrestle > links into being relative to the site as a whole, not relative to > drupal, but I'm not seeing it. > > This doesn't appear to be controlled by "theme_menu_links" > http://api.drupal.org/api/function/theme_menu_links/5 > > Any suggestions? > > Thanks, > Amanda > >
- -- [ Drupal support list | http://lists.drupal.org/ ]
- -- Amanda, Bee http://velociraptor.info/notes
I'm not quite clear on exactly what you're trying to do either, but i'll take a stab at it.
If you hard code /news/ in then it will always go to /news/ whether you're in a subdirectory or not - it gets interpreted by the browser, not by drupal or anything else.
If you want it to go to news in drupal whether your drupal is at root or in a subdirectory then you want to use <?php print base_path()?>news/ (you may need a slash in front of news can't remember) that way if the base of drupal is at root nothing will get added but if it's /drupal/ and you therefore want it to go to /drupal/news/ then /drupal/ will be added automagically.
.s
Amanda Bee wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I don't want drupal to do anything. If I set the path to "/news/" I want drupal to make a link that says <a href="/news/">Foo</a> and not <a href="/drupal//news/">Foo</a>.
This is obviously some kind of rocket science like I never imagined.
Cog Rusty wrote:
On 10/31/07, Amanda B Hickman amanda@velociraptor.info wrote: Thanks for taking a stab at it. Here are some responses that I hope will clarify my troubles a wee bit ...
Cog Rusty wrote:
Generally, if you access your Drupal site as http://www.example.com/drupal/ then that's your site's web root.
Right, that is my drupal site's root.
If you use a fully qualified URL in a menu to take you to http://www.example.com/news that will take you outside Drupal, unless you have set up a Drupal site for http://www.example.com.
Right: a fully qualified URL will do that, but I'd have to include the domain name (http://www.example.com). The site is moving around, however, and the domain name could be any of ...
http://www.example.com http://staging.example.com http://example.local
And I want to be able to test out the menus and other changes on a staging site before I push the drupal section live.
I still don't understand. You want that menu link to change, based on what? If you are in a http://www.example.com/drupal site, how could the menu link switch to any other domain? Based on what? If you manage to use an apache rewrite, what condition is that going to check for changing domain? I don't see any other way except depending on the domain of the Drupal site that you are currently in.
I am not sure I completely understand what you are trying to achieve and what you are running in your http://www.example.com site, but the
The rest of the site uses a frightening home-brewed content management system developed over many years by many programmers. I'm in the process of streamlining that, but first I'd like to get a few things into drupal and working well (our forums, for one thing).
usual method of using multiple domain names is to point all domain names to Drupal's installation directory and set up respective settings.php files for the different domains to use the same database ($db_url).
Drupal works fine under each of these domain names, and the separate settings.php files in sites/example.local and sites/staging.example.com do a fine job of pointing it off to different databases depending on where I'm accessing it from. That part works fine.
Consider
- setting up Drupal sites for all the domains or subdomains you want
(see http://drupal.org/node/147828),
- don't set up a Drupal site for http://www.example.com/drupal/,
- and use your .htaccess file to make Drupal leave alone certain paths
of your other application (http://drupal.org/node/30334).
There was a discussion about using some .htaccess tricks (http://drupal.org/node/144643) but I wouldn't go there before trying all the standard methods. This kind of .htaccess tricks tend to make a setup fragile.
I'm not dying to go the .htaccess route, I promise, but I can't figure out how to persuade drupal that a path in the menu like "/news/" is relative to the whole site, not relative to drupal.
On 10/30/07, Amanda Bee amanda@velociraptor.info wrote: I'm still working on this, though I suspect from my reading that the real solution lies in .htaccess rewrite rules.
I thought this:
RewriteRule ^/drupal//(.*) /$1 [L]
Would work -- take paths that have the double slash and bump them up a level to the root of the site -- but it doesn't seem to be taking. For bonus fun I tried quirky variations like ...
RewriteRule ^/drupal//(.*) /drupal/foo/$1 [L]
And didn't get anywhere either. Am I even making sense here?
Thanks, amanda
(http://drupal.org/node/187647)
Amanda B Hickman wrote:
>> I'm puzzling through a few things at once and starting to hit walls on >> this one as well. >> >> I've got drupal set up in a subdirectory of a larger site. That larger >> site is in subversion and I run a staging site and a few local >> incarnations of it, which means that the site's domain name changes >> periodically, from "staging.example.com" to "example.local" or >> "www.example.com" >> >> Right now, I've got the site's overall primary links in drupal as >> primary links, and I'd like to keep them there, but drupal is gobbling >> up the absolute paths even though they're absolute: >> >> I gave the menu path as >> >> "/news/" and drupal points to >> >> "http://staging.example.com/drupal//news/" when I'm aiming for >> >> "http://staging.example.com/news" >> >> I spent a lot of time monkeying with clean URLs on the theory that >> they'd fix this, only to discover ... nope. >> >> I've looked around for a themeable function that would let me wrestle >> links into being relative to the site as a whole, not relative to >> drupal, but I'm not seeing it. >> >> This doesn't appear to be controlled by "theme_menu_links" >> http://api.drupal.org/api/function/theme_menu_links/5 >> >> Any suggestions? >> >> Thanks, >> Amanda >> >>
[ Drupal support list | http://lists.drupal.org/ ]
Amanda, Bee http://velociraptor.info/notes -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHKKBjrxDTsWdh5zkRAhN9AKCh8/o4ZnnOdCODDihn9ju6xF39rgCfS/YF Wk9T8xpdyPKvhxRf3MuIq+s= =gjvi -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
If you hard code /news/ in then it will always go to /news/ whether you're in a subdirectory or not - it gets interpreted by the browser, not by drupal or anything else.
That is correct, but that means forgoing the content management aspect of incorporating drupal into part of the site. I'd really like to be able to edit our primary navigation from within drupal, so that I can tell everyone that the first rule is you do not touch the template. Hard coding it, by actually manually spelling out my primary navigation in the template itself, is less than ideal.
If you want it to go to news in drupal whether your drupal is at root or in a subdirectory then you want to use
<?php print base_path()?>news/ (you may need a slash in front of news
can't remember)
I do not want to go to /drupal/news/ I want the link to point to /news/
that way if the base of drupal is at root nothing will get added but if it's /drupal/ and you therefore want it to go to /drupal/news/ then /drupal/ will be added automagically.
It is that automagic that I would like to undo. I want to be able to use drupals menus to point outside of drupal to other parts of my site. In a similar vein, if I use drupal's inner workings to set the URL of our favicon, I end up with a lot of file not found errors because /drupal//graphics/favicon.ico can't be found. I don't want to have to keep a duplicate favicon.
- -Amanda
.s
Amanda Bee wrote: I don't want drupal to do anything. If I set the path to "/news/" I want drupal to make a link that says <a href="/news/">Foo</a> and not <a href="/drupal//news/">Foo</a>.
This is obviously some kind of rocket science like I never imagined.
Cog Rusty wrote:
On 10/31/07, Amanda B Hickman amanda@velociraptor.info wrote: Thanks for taking a stab at it. Here are some responses that I hope will clarify my troubles a wee bit ...
Cog Rusty wrote:
> Generally, if you access your Drupal site as > http://www.example.com/drupal/ then that's your site's web root.
Right, that is my drupal site's root.
> If you use a fully qualified URL in a menu to take you to > http://www.example.com/news that will take you outside Drupal, unless > you have set up a Drupal site for http://www.example.com.
Right: a fully qualified URL will do that, but I'd have to include the domain name (http://www.example.com). The site is moving around, however, and the domain name could be any of ...
http://www.example.com http://staging.example.com http://example.local
And I want to be able to test out the menus and other changes on a staging site before I push the drupal section live.
I still don't understand. You want that menu link to change, based on what? If you are in a http://www.example.com/drupal site, how could the menu link switch to any other domain? Based on what? If you manage to use an apache rewrite, what condition is that going to check for changing domain? I don't see any other way except depending on the domain of the Drupal site that you are currently in.
> I am not sure I completely understand what you are trying to achieve > and what you are running in your http://www.example.com site, but the
The rest of the site uses a frightening home-brewed content management system developed over many years by many programmers. I'm in the process of streamlining that, but first I'd like to get a few things into drupal and working well (our forums, for one thing).
> usual method of using multiple domain names is to point all domain > names to Drupal's installation directory and set up respective > settings.php files for the different domains to use the same database > ($db_url).
Drupal works fine under each of these domain names, and the separate settings.php files in sites/example.local and sites/staging.example.com do a fine job of pointing it off to different databases depending on where I'm accessing it from. That part works fine.
> Consider > - setting up Drupal sites for all the domains or subdomains you want > (see http://drupal.org/node/147828), > - don't set up a Drupal site for http://www.example.com/drupal/, > - and use your .htaccess file to make Drupal leave alone certain paths > of your other application (http://drupal.org/node/30334). > > There was a discussion about using some .htaccess tricks > (http://drupal.org/node/144643) but I wouldn't go there before trying > all the standard methods. This kind of .htaccess tricks tend to make a > setup fragile.
I'm not dying to go the .htaccess route, I promise, but I can't figure out how to persuade drupal that a path in the menu like "/news/" is relative to the whole site, not relative to drupal.
> On 10/30/07, Amanda Bee amanda@velociraptor.info wrote: > I'm still working on this, though I suspect from my reading that the > real solution lies in .htaccess rewrite rules. > > I thought this: > > RewriteRule ^/drupal//(.*) /$1 [L] > > Would work -- take paths that have the double slash and bump them up a > level to the root of the site -- but it doesn't seem to be taking. For > bonus fun I tried quirky variations like ... > > RewriteRule ^/drupal//(.*) /drupal/foo/$1 [L] > > And didn't get anywhere either. Am I even making sense here? > > Thanks, > amanda > > (http://drupal.org/node/187647) > > > Amanda B Hickman wrote: >>>> I'm puzzling through a few things at once and starting to hit walls on >>>> this one as well. >>>> >>>> I've got drupal set up in a subdirectory of a larger site. That larger >>>> site is in subversion and I run a staging site and a few local >>>> incarnations of it, which means that the site's domain name changes >>>> periodically, from "staging.example.com" to "example.local" or >>>> "www.example.com" >>>> >>>> Right now, I've got the site's overall primary links in drupal as >>>> primary links, and I'd like to keep them there, but drupal is gobbling >>>> up the absolute paths even though they're absolute: >>>> >>>> I gave the menu path as >>>> >>>> "/news/" and drupal points to >>>> >>>> "http://staging.example.com/drupal//news/" when I'm aiming for >>>> >>>> "http://staging.example.com/news" >>>> >>>> I spent a lot of time monkeying with clean URLs on the theory that >>>> they'd fix this, only to discover ... nope. >>>> >>>> I've looked around for a themeable function that would let me wrestle >>>> links into being relative to the site as a whole, not relative to >>>> drupal, but I'm not seeing it. >>>> >>>> This doesn't appear to be controlled by "theme_menu_links" >>>> http://api.drupal.org/api/function/theme_menu_links/5 >>>> >>>> Any suggestions? >>>> >>>> Thanks, >>>> Amanda >>>> >>>>
- -- Amanda B Hickman (p) 917 655 2579 (s) amandabee (a) amandahlinc (w) http://velociraptor.info
On 10/31/07, Amanda Bee amanda@velociraptor.info wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I don't want drupal to do anything. If I set the path to "/news/" I want drupal to make a link that says <a href="/news/">Foo</a> and not <a href="/drupal//news/">Foo</a>.
This is obviously some kind of rocket science like I never imagined.
1. If you want it to always go to http://www.example.com/news, then why can't you simply use a fully qualified URL.
2. If you want the domain to vary, then I can't see on what condition can this varying depend (except on Drupal's installation path itself).
Hence my confusion.
Cog Rusty wrote:
On 10/31/07, Amanda B Hickman amanda@velociraptor.info wrote: Thanks for taking a stab at it. Here are some responses that I hope will clarify my troubles a wee bit ...
Cog Rusty wrote:
Generally, if you access your Drupal site as http://www.example.com/drupal/ then that's your site's web root.
Right, that is my drupal site's root.
If you use a fully qualified URL in a menu to take you to http://www.example.com/news that will take you outside Drupal, unless you have set up a Drupal site for http://www.example.com.
Right: a fully qualified URL will do that, but I'd have to include the domain name (http://www.example.com). The site is moving around, however, and the domain name could be any of ...
http://www.example.com http://staging.example.com http://example.local
And I want to be able to test out the menus and other changes on a staging site before I push the drupal section live.
I still don't understand. You want that menu link to change, based on what? If you are in a http://www.example.com/drupal site, how could the menu link switch to any other domain? Based on what?
If you manage to use an apache rewrite, what condition is that going to check for changing domain?
I don't see any other way except depending on the domain of the Drupal site that you are currently in.
I am not sure I completely understand what you are trying to achieve and what you are running in your http://www.example.com site, but the
The rest of the site uses a frightening home-brewed content management system developed over many years by many programmers. I'm in the process of streamlining that, but first I'd like to get a few things into drupal and working well (our forums, for one thing).
usual method of using multiple domain names is to point all domain names to Drupal's installation directory and set up respective settings.php files for the different domains to use the same database ($db_url).
Drupal works fine under each of these domain names, and the separate settings.php files in sites/example.local and sites/staging.example.com do a fine job of pointing it off to different databases depending on where I'm accessing it from. That part works fine.
Consider
- setting up Drupal sites for all the domains or subdomains you want
(see http://drupal.org/node/147828),
- don't set up a Drupal site for http://www.example.com/drupal/,
- and use your .htaccess file to make Drupal leave alone certain paths
of your other application (http://drupal.org/node/30334).
There was a discussion about using some .htaccess tricks (http://drupal.org/node/144643) but I wouldn't go there before trying all the standard methods. This kind of .htaccess tricks tend to make a setup fragile.
I'm not dying to go the .htaccess route, I promise, but I can't figure out how to persuade drupal that a path in the menu like "/news/" is relative to the whole site, not relative to drupal.
On 10/30/07, Amanda Bee amanda@velociraptor.info wrote: I'm still working on this, though I suspect from my reading that the real solution lies in .htaccess rewrite rules.
I thought this:
RewriteRule ^/drupal//(.*) /$1 [L]
Would work -- take paths that have the double slash and bump them up a level to the root of the site -- but it doesn't seem to be taking. For bonus fun I tried quirky variations like ...
RewriteRule ^/drupal//(.*) /drupal/foo/$1 [L]
And didn't get anywhere either. Am I even making sense here?
Thanks, amanda
(http://drupal.org/node/187647)
Amanda B Hickman wrote:
>> I'm puzzling through a few things at once and starting to hit walls on >> this one as well. >> >> I've got drupal set up in a subdirectory of a larger site. That larger >> site is in subversion and I run a staging site and a few local >> incarnations of it, which means that the site's domain name changes >> periodically, from "staging.example.com" to "example.local" or >> "www.example.com" >> >> Right now, I've got the site's overall primary links in drupal as >> primary links, and I'd like to keep them there, but drupal is gobbling >> up the absolute paths even though they're absolute: >> >> I gave the menu path as >> >> "/news/" and drupal points to >> >> "http://staging.example.com/drupal//news/" when I'm aiming for >> >> "http://staging.example.com/news" >> >> I spent a lot of time monkeying with clean URLs on the theory that >> they'd fix this, only to discover ... nope. >> >> I've looked around for a themeable function that would let me wrestle >> links into being relative to the site as a whole, not relative to >> drupal, but I'm not seeing it. >> >> This doesn't appear to be controlled by "theme_menu_links" >> http://api.drupal.org/api/function/theme_menu_links/5 >> >> Any suggestions? >> >> Thanks, >> Amanda >> >>
[ Drupal support list | http://lists.drupal.org/ ]
Amanda, Bee http://velociraptor.info/notes -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHKKBjrxDTsWdh5zkRAhN9AKCh8/o4ZnnOdCODDihn9ju6xF39rgCfS/YF Wk9T8xpdyPKvhxRf3MuIq+s= =gjvi
-----END PGP SIGNATURE-----
[ Drupal support list | http://lists.drupal.org/ ]
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Cog Rusty wrote:
On 10/31/07, Amanda Bee amanda@velociraptor.info wrote: I don't want drupal to do anything. If I set the path to "/news/" I want drupal to make a link that says <a href="/news/">Foo</a> and not <a href="/drupal//news/">Foo</a>.
This is obviously some kind of rocket science like I never imagined.
- If you want it to always go to http://www.example.com/news, then
why can't you simply use a fully qualified URL.
Because depending on the machine I'm working from the fully qualified URL could be any of
http://www.example.com/news -- which needs to work when I push the whole thing live; http://staging.example.com/news -- which needs to work while I'm testing it; http://example.local/news -- which needs to work if I'm going to be able to do any work when I'm offline or on a train. Or on an offline train. Which I spend more time doing than I really like, working on trains.
- If you want the domain to vary, then I can't see on what condition
can this varying depend (except on Drupal's installation path itself).
The domain varies depending on which site I'm working on -- my local offline copy, the public facing staging site, or the live site. I need to be able to work and test changes and invite review on the staging site, and as a matter of basic practice I want to limit the amount of steps that it takes to push code changes live.
Hence my confusion.
- -- [ Drupal support list | http://lists.drupal.org/ ]
- -- Amanda B Hickman (p) 917 655 2579 (s) amandabee (a) amandahlinc (w) http://velociraptor.info
On 10/31/07, Amanda B Hickman amanda@velociraptor.info wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Cog Rusty wrote:
On 10/31/07, Amanda Bee amanda@velociraptor.info wrote: I don't want drupal to do anything. If I set the path to "/news/" I want drupal to make a link that says <a href="/news/">Foo</a> and not <a href="/drupal//news/">Foo</a>.
This is obviously some kind of rocket science like I never imagined.
- If you want it to always go to http://www.example.com/news, then
why can't you simply use a fully qualified URL.
Because depending on the machine I'm working from the fully qualified URL could be any of
http://www.example.com/news -- which needs to work when I push the whole thing live; http://staging.example.com/news -- which needs to work while I'm testing it; http://example.local/news -- which needs to work if I'm going to be able to do any work when I'm offline or on a train. Or on an offline train. Which I spend more time doing than I really like, working on trains.
- If you want the domain to vary, then I can't see on what condition
can this varying depend (except on Drupal's installation path itself).
The domain varies depending on which site I'm working on -- my local offline copy, the public facing staging site, or the live site. I need to be able to work and test changes and invite review on the staging site, and as a matter of basic practice I want to limit the amount of steps that it takes to push code changes live.
Oh, I see. Then you could leave the menu entry as simply "news" and use a rewrite like this one
RewriteCond %{REQUEST_URI} ^/drupal/news RewriteRule .* /news [L]
somewhere before the last block of Drupal rewrites. That should change /drupal/news to /news.
Hence my confusion.
[ Drupal support list | http://lists.drupal.org/ ]
Amanda B Hickman (p) 917 655 2579 (s) amandabee (a) amandahlinc (w) http://velociraptor.info -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHKMEBrxDTsWdh5zkRAtMwAKCAfK3Il4eZd5dWSzyIyj882XqBnACbBL0m 50zN3XXlLkLGMiJBW1obZrE= =LdVu
-----END PGP SIGNATURE-----
[ Drupal support list | http://lists.drupal.org/ ]
Quoting Cog Rusty cog.rusty@gmail.com:
On 10/31/07, Amanda Bee amanda@velociraptor.info wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I don't want drupal to do anything. If I set the path to "/news/" I want drupal to make a link that says <a href="/news/">Foo</a> and not <a href="/drupal//news/">Foo</a>.
This is obviously some kind of rocket science like I never imagined.
- If you want it to always go to http://www.example.com/news, then
why can't you simply use a fully qualified URL.
- If you want the domain to vary, then I can't see on what condition
can this varying depend (except on Drupal's installation path itself).
Hence my confusion.
You seem to miss that Amanda is incorporating Drupal into an existing system and she wants the existing URL to work within the Drupal menu system. The Drupal menu system is doing its magic with the URL so that the relative /news/ becomes q=/news/ instead. You also miss that Amanda has more than one URL to apply her magic to so she cannot hard code the host data to the reference.
Perhaps some php coding using http://api.drupal.org/api/function/hook_link/5 could solve the problem. But a tag list references in a new block could also suffice.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Earnie Boyd wrote:
Quoting Cog Rusty cog.rusty@gmail.com:
On 10/31/07, Amanda Bee amanda@velociraptor.info wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I don't want drupal to do anything. If I set the path to "/news/" I want drupal to make a link that says <a href="/news/">Foo</a> and not <a href="/drupal//news/">Foo</a>.
This is obviously some kind of rocket science like I never imagined.
- If you want it to always go to http://www.example.com/news, then
why can't you simply use a fully qualified URL.
- If you want the domain to vary, then I can't see on what condition
can this varying depend (except on Drupal's installation path itself).
Hence my confusion.
You seem to miss that Amanda is incorporating Drupal into an existing system and she wants the existing URL to work within the Drupal menu system. The Drupal menu system is doing its magic with the URL so that the relative /news/ becomes q=/news/ instead. You also miss that Amanda has more than one URL to apply her magic to so she cannot hard code the host data to the reference.
Actually, Cog (is that a real name, cog rusty?) got me started. Reading up on RewriteCond and wildcards got me as far as ...
RewriteCond %{REQUEST_URI} ^/drupal//.* RewriteRule (.*) /$1 [L]
I'm halfway there. Or three quarters of the way there. Nine tenths. Now what I've got is that the menus link to "/drupal//news/" and the page loads the content that also appears at "/news/" sitewide. Which of course has forced me to realize that what I really want is not URL rewrites, but actual redirects. Still, this keeps the site intact as a whole so it is plenty good enough.
Next up, I'm thinking I might need to get my bicycle overhauled (get it? rusty cog? are you not doubled over laughing now? I sure am)
Thank you, effusively.
Perhaps some php coding using http://api.drupal.org/api/function/hook_link/5 could solve the problem. But a tag list references in a new block could also suffice.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
- -- Amanda B Hickman (p) 917 655 2579 (s) amandabee (a) amandahlinc (w) http://velociraptor.info
RewriteCond %{REQUEST_URI} ^/drupal//.* RewriteRule (.*) /$1 [L]
I'm halfway there. Or three quarters of the way there. Nine tenths. Now what I've got is that the menus link to "/drupal//news/" and the page loads the content that also appears at "/news/" sitewide. Which of course has forced me to realize that what I really want is not URL rewrites, but actual redirects. Still, this keeps the site intact as a whole so it is plenty good enough.
I believe adding in an R will change it to a redirect instead of a rewrite:
RewriteCond %{REQUEST_URI} ^/drupal//.* RewriteRule (.*) /$1 [L,R]
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Huzzah.
This is perfect. Thank you.
sander-martijn wrote:
RewriteCond %{REQUEST_URI} ^/drupal//.* RewriteRule (.*) /$1 [L]
I'm halfway there. Or three quarters of the way there. Nine tenths. Now what I've got is that the menus link to "/drupal//news/" and the page loads the content that also appears at "/news/" sitewide. Which of course has forced me to realize that what I really want is not URL rewrites, but actual redirects. Still, this keeps the site intact as a whole so it is plenty good enough.
I believe adding in an R will change it to a redirect instead of a rewrite:
RewriteCond %{REQUEST_URI} ^/drupal//.* RewriteRule (.*) /$1 [L,R]
- -- Amanda B Hickman (p) 917 655 2579 (s) amandabee (a) amandahlinc (w) http://velociraptor.info
On 10/31/07, Amanda B Hickman amanda@velociraptor.info wrote:
Next up, I'm thinking I might need to get my bicycle overhauled (get it? rusty cog? are you not doubled over laughing now? I sure am)
Actually cog.rusty is a description rather than a name. It has to do with cognition, lack of intrinsic motivation, facilitating motion while questioning the need to turn, and a few other things which would take me even more off-topic and wouldn't do much good to that bicycle except by accident.
On 10/31/07, Amanda B Hickman amanda@velociraptor.info wrote:
Actually, Cog (is that a real name, cog rusty?) got me started. Reading up on RewriteCond and wildcards got me as far as ...
RewriteCond %{REQUEST_URI} ^/drupal//.* RewriteRule (.*) /$1 [L]
I'm halfway there. Or three quarters of the way there. Nine tenths. Now what I've got is that the menus link to "/drupal//news/" and the page loads the content that also appears at "/news/" sitewide. Which of course has forced me to realize that what I really want is not URL rewrites, but actual redirects. Still, this keeps the site intact as a whole so it is plenty good enough.
Glad that you figured out something with those rewrites. The only way I could think for making the links not to refer to Drupal at all is to abandon the menu system and put your menu links directly in a block using PHP like this:
$_SERVER['HTTP_HOST'] . '/news';