I'm sorry I'm fairly new to Global Redirect module. I've installed the latest version (1.2) on Drupal 6.9 with path module and pathauto module. I've created a new page and then tried accessing it using the node number and it still displays and doesn't forward to the clean url version. Am I missing something here?

Comments

jaharmi’s picture

I'm seeing the same thing, with pages on Acquia Drupal 1.2.1 (Drupal 6.9). I'm also up-to-date with Global Redirect.

For example:

http://www.jaharmi.com/node/383
http://www.jaharmi.com/2009/01/27/check_a_new_version_of_acquia_drupal_i...

Is there any other information (logs or otherwise) that I can provide to help determine what might be going awry?

Mac Ryan’s picture

I am having the same issue. D 6.9 and GR 6.x-1.2
Pathauto and Path also installed and running.

Anonymous’s picture

Running latest Drupal, Pathauto and Global Redirect and NOT seeing this issue , if that helps

czeky’s picture

Hi, same here, nodes in node/1 etc are not redirected to pathauto alias, any ideas?

Anonymous’s picture

The only things i can think of are if drupal is installed in a subdomain or a folder rather than in root

that is

mydomain.com/drupal

or

drupal.mydomain.com

rather than in

mydomain.com

czeky’s picture

Yes, it is in folder, could it be the issue?

Thanx

Anonymous’s picture

Its possible - Here is a previous issue http://drupal.org/node/343701 When i was developing my site i had it in a folder/subdomain and re-direct didnt work within its installation. As soon as i moved to live - root all worked perfect. Not sure why this is but it may at least help identify the cause

nicholasthompson’s picture

Title: Not redirecting » Not redirecting (possibly an issue with installations in subfolders)
Category: support » bug

Hi guys - just so you know I am following this issue but I'm ridiculously busy at the moment.

I'll try to find time to look into this - but it is likely an issue with a subfolder. Sub domains wont effect GlobalRedirect (as, technically, www. is a subdomain and I've had no problems with www.example.com type sites.).

Anonymous’s picture

I accept what your saying about subdomains iI know very little as to how servers work , but as a thought

my working site www.mydomain.com is located at

public_html/

a sub folder would be

public_html/drupal

if I had a subdomain called drupal.mydomain.com it is also located at

public_html/drupal

In theory it can also be called from www.mydomain.com/drupal

Maybe there is something outside the folder causing the issue

jaharmi’s picture

My site is also located in a subfolder of my public_html folder. I just checked, and it’s available through both example.com and example.com/example. Node and Pathauto URLs also work with the folder name after the slash, at the root of the site. Hm.

Maybe if the URL is rewritten so that portion doesn’t appear, ever … ?

I don’t recall this being a problem with Global Redirect on Drupal 5, before I upgraded to Drupal 6 via Acquia Drupal. But I don’t know that I ever specifically checked, either.

nicholasthompson’s picture

Component: User interface » Code
Priority: Normal » Critical

Sounds like an issue with installations in subfolders... I'll have to test. Upping to critical.

Cheers.

Durran’s picture

I have drupal installed into the root directory of my site and it does not redirect either..
So.. Possibly not a subfolder issue.
That being said, I have a large taxonomy that is displayed via taxonomy_DHTML (or, was until today. I opted to use a php snippet instead for now, but its ugly) and that module does not support/request Pathauto, so all the terms are linked to a drupal version and not pathauto. None of those links are redirected.

I would like to see whats going on?
Thanks

nicholasthompson’s picture

nurrad, if you make links in your PHP snippet using the l function, then aliases are picked up automatically.

As for other people - I cant replicate it at the moment so the more information you can supply me with (such as URL, server config (eg PHP versions, etc) and anything else you deem relevant) would really help.

Cheers

Anonymous’s picture

I can give you a couple of links for comparison, though will take the second one off line after a few days ( its not normally live)

http://www.crydee.com

to get to the second site replace "www" with "cms2" I havn't used a link as i dont want it indexed

On the right side you should see a Quiz banner under test your knowledge

in the first site mouse over indicates "node/10261" when cliked it re-directs to ..../quiz

for the second link (cms2) mouse over indicates "node/10261" when cliked it re-directs to "node/10261" :)

The second site is basically a clone of the main though some modules are now out of date and its still on 6.8

MySQL database 5.0.67
PHP 5.2.6
PHP memory limit 128M
PHP register globals Disabled

Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8b DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635

Anonymous’s picture

I would have posted this sooner but someone decided to upgrade drupal moments after i posted. :) I would also have edited my last post but they broke that too !

I found what appears to be the cause in my case, and something i hadn't realised.

After creating my post i remembered I had forgotton to put the second site online. And there was the Answer ( both sites web based) but if they are offline Globa Redirectl does not re-direct. This may be the issue or by design

usa2k’s picture

Subscribing

In my case, I have an internal server (Intranet)
(Orig URL) Link http://192.168.0.88/repair/node/1568
(URL Alias) Link http://192.168.0.88/repair/content/304-0111d

It does not redirect on D6.10

EDIT: Not 100% sure I need this module?
I cleared out a whole list of records and regenerated them with
Alias URL and Node Autotitle set right and I seem to only get aliased URLs.

Still new and learning here ...

Anonymous’s picture

Apologies but I'm still confused after reading... Should global redirect 6.x-1.2 module be working on drupal 6.10 if drupal is installed in a subdirectory, e.g. www.example.com/drupal, do people have global redirect working if set up like this?

Thanks.

--Dave

danfinney’s picture

Having a similar issue with the XML path showing the url without a trailing slash, but the site redirects to using the trailing slash. Full details below.

XML Base Path - Google Webmaster Tools Redirect Error

http://drupal.org/node/446280

robertjd’s picture

I am having this problem as well and it does seem to be subfolder related. I have drupal setup in a subdirectory, like so:

~/public_html/robertjd/drupal

where ~/public_html/robertjd/ is the web root for www.robertjd.com with a rewrite to /drupal using the following .htaccess in ~/public_html/robertjd

RewriteEngine on
RewriteRule (.*) drupal/$1 [L]

$base_url in sites/default/settings.php is

$base_url="http://www.robertjd.com";

Thus, my $GLOBALS['base_path'] is "/" and $_SERVER['SCRIPT_NAME'] is "/drupal/index.php" which is the conundrum outlined here: http://drupal.org/node/304025

Is there a way out of this by not setting $base_url and doing some fancy apache rewriting?

dawansv’s picture

Status: Active » Needs work

Ok, so I have the exact same problem. My $GLOBALS['base_path'] is "/" and $_SERVER['SCRIPT_NAME'] is "/drupal6/index.php" (on my production server) while it is fine on my development server (I don't use a subfolder there).

I think I might have found a way to fix it (at least in my setup) using the SERVER[REQUEST_URI] and SERVER['REDIRECT_URL'] variables. In a simple subfolder rewrite rule, SERVER['REDIRECT_URL'] is in fact equal to /subfolder/SERVER[REQUEST_URI], so I extract the subfolder from the difference, then add it to the test...

Problem is this is assuming either no rewrite rule or a rewrite rule producing the redirect above, so this will break down if other kind of redirect takes place where the second part of SERVER['REDIRECT_URL'] is not SERVER[REQUEST_URI] (or both are equal if no redirect).

But here are my changes that for me makes the same code work on both dev and production server...

I change:
if ($_SERVER['SCRIPT_NAME'] != $GLOBALS['base_path'] .'index.php') return FALSE;

to:

$request = $_SERVER['REQUEST_URI'];
$redirect = $_SERVER['REDIRECT_URL'];
$redirect_path = substr ($redirect,0,strpos($redirect,$request));
if ($_SERVER['SCRIPT_NAME'] != $redirect_path . $GLOBALS['base_path'] .'index.php') return FALSE;

portulaca’s picture

GR is not working on one of my multisites, but at the same time it works on others.

On the site where it doesn't works I recently generated all the aliases, and aliases work ok, but entering node/ID into address bar doesn't redirect it to the alias.

GR works ok on my local installation, even for the site that doesn't work on host.

Can I work around it by excluding node/ID from indexing using robots.txt?

tommyk’s picture

Just wanted to chime in here that I also think I have a problem when Drupal is installed in a subfolder.

I just recently moved the Drupal site in my webroot into a subfolder and now URLs like http://example.com/node/19 do not redirect to their aliases.

In ~/public_html on my webroot I have an .htaccess and a folder called example.com. This .htaccess file contains:

RewriteEngine on
RewriteRule ^$ /example.com/ [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /example.com/$1 [L]

This way the Drupal site in the folder example.com appears on the main domain, http://example.com/

In the ~/public_html/example.com/.htaccess file I have redirected users to the address without www and also uncommented:

RewriteBase /

And in ~/public_html/example.com/sites/default/settings.php I have uncommented this line:

$base_url = 'http://example.com';  // NO trailing slash!

Does this look like the proper procedure? Is this what others are experiencing when Global Redirect stops working or doesn't work?

EdinburghRob’s picture

Hi dawansv,

That solution works for me. Thanks :-)

I think that's a good solution.

eagereyes’s picture

I'm having the same issue. I simple commented out the line dawansv replaced, and it seems to work now (his patch didn't work for me).

I'm using nginx, and I'm wondering if that could be part of the issue. I've seen some issues with other modules that seem to have to do with REQUEST_URI and how that is handled slightly differently by nginx.

In any case, I think this really needs to be addressed. I've been using this module for a long time, and it definitely worked at some point. I only just realized that it doesn't work by accident today. But this is really an important module that needs to get the attention to fix this kind of issue.

nicholasthompson’s picture

I've just tried this on my Lighttpd devbox (which uses a LUA script to handle Clean URL's) and both DRUPAL-6--1-2 and DRUPAL-6--1 work fine.

This leads me to believe there is either a server config error (such as the RewriteBase in Apache) *or* there is an incompatibility specifically between GR and one of the HTTP Servers.

I recall recently having issues with Apache 2.2 on a system running VirtualDocumentRoot's... Apache did not pass the correct $_SERVER['document_root'] over, even with the RewriteBase set correctly. The result was ImageCache was unable to build it's images as the document root didn't match the files folder path correctly. Maybe this is a similar issue.

For those having issues with Apache, does adding this to the end of the site's settings.php this help?

$_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['SCRIPT_NAME'],"",$_SERVER['SCRIPT_FILENAME']);
nicholasthompson’s picture

Status: Needs work » Closed (duplicate)

There is a fix for this in #304025: not working when drupal is installed in a subdirectory so I'm marking this as duplicate.