Forum Moderators: phranque

Message Too Old, No Replies

Rewrite Redirect, not sure

         

Brian_L

9:46 pm on Nov 23, 2010 (gmt 0)

10+ Year Member



Really not sure what's the best way to do this.

I have a url like:
[mydomain.com...]

it uses drupal so all pages load as:
[mydomain.com...] etc

it has integrated gallery2, that is located at
[mydomain.com...]
and urls like:
[mydomain.com...]

I want to move the page up to a particular location whenever you are viewing the gallery

I tried a rewrite to append #mylocation to the end of the url whenever it is on a gallery page. I have been less than successful.


if i manually add #mylocation to the end of the url it loads correctly, I need to automate this.
[mydomain.com...]

any ideas on what is the best way to do this?

thanks

Brian_L

2:06 pm on Nov 24, 2010 (gmt 0)

10+ Year Member



well the more I think about it the more I think that I will be grepping through php files to find where the url is constructed, and fix it that way

Brian_L

2:54 pm on Nov 24, 2010 (gmt 0)

10+ Year Member



Well, I got it to work.
I just edited gallery2/modules/core/classes/GalleryUrlGenerator.class
and appended the info there.
in function generateUrl I added this at the end, right before return $url

$url.= "#mylocation";


jdMorgan

4:44 pm on Dec 1, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That is the correct solution, as any other would *not* publish the correct URL to the Web, and thus require you to redirect or rewrite client requests -- and search engines don't very much like it when you link to URLs that immediately invoke a redirect. This is taken as a sign of low-quality site administration, and warnings in your Google Webmaster Tools reports are the result.

So, you've found the 'clean' way to fix the root problem, rather than just putting a band-aid on it.

Jim