Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> ShortLinks/TegoNuke
Author Message
spasticdonkey
RavenNuke(tm) Development Team


Joined: Dec 02, 2006
Posts: 1692
Location: Texas, USA

PostPosted: Mon Feb 09, 2009 6:57 pm Reply with quote

Did a simple custom module to replace a content page, and was wondering the correct way to forward a shortlink'd URL?

I tried....
Code:
Redirect /content-6.html http://www.mysite.com/mynewpage.html

and i end up with a link like this... Sad Only registered users can see links on this board! Get registered or login!

and if i try
Code:
Redirect /modules.php?name=Content&pa=showpage&pid=6 http://www.mysite.com/mynewpage.html


it doesn't forward the shortened URL content-6.html

any ideas? do i need to alter the re-writes?
 
View user's profile Send private message Visit poster's website
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6792
Location: Ha Noi, Viet Nam

PostPosted: Mon Feb 09, 2009 7:37 pm Reply with quote

Where you place the redirect in the htaccess file might have some affect, it should preferably be after all other rules.
 
View user's profile Send private message Send e-mail
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Mon Feb 09, 2009 7:52 pm Reply with quote

As far as I know, Redirect rules only take the base URL (with no parameters)

So it will only take
modules.php
and not
modules.php?name=...

Your only choice would be to use conditionals
Code:


RewriteCond %{QUERY_STRING} name=Content&pa=showpage&pid=6

Theoretically that should work, but always had problems with QUERY_STRING myself

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Misha
Worker
Worker


Joined: Jul 30, 2006
Posts: 203
Location: McLean, VA

PostPosted: Tue Feb 10, 2009 11:19 am Reply with quote

LOL I just came to ask the similar question.

For a few hours already I am trying to redirect /content-11.html to /33-gas-saving-tips.html

Here is what I have in my .htaccess, only relevant lines in their order:

Code:
Redirect 301 /content-11.html http://XXXXX.com/33-gas-saving-tips.html

.
.
.
RewriteRule ^33-gas-saving-tips.html modules .php?nam e=Content&pa=showpage&pid=11 [L]
.
.
.
RewriteRule ^content-([0-9]*).html modules .php?nam e=Content&pa=showpage&pid=$1 [L]


When I go to

content-11.html

I get

33-gas-saving-tips.html?name=Content&pa=showpage&pid=11

If I comment out the last rewrite rule, it works properly - yet no other content page rewrite works of course.

Just tried to put redirect 301 after all the rules, as Guardian suggested - does not work for me... And not sure I understand Evaders' suggestion...

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
spasticdonkey
PostPosted: Tue Feb 10, 2009 2:04 pm Reply with quote

ya i worked on it for awhile with no luck Sad

even though i have deleted the content from this page, google still sees it as one of the most important in my site, instead of it's replacement, ugggg...

any ideas from an SEO perspective that might help cure this by other means?
 
alien73
Involved
Involved


Joined: Sep 15, 2008
Posts: 352

PostPosted: Tue Feb 10, 2009 2:58 pm Reply with quote

Try this in your .htaccess file.. The only problem is it may loop since modules.php?name=Content&pa=showpage&pid=6 is already rewritten through shortlinks

RewriteRule ^yournewpage.html modules.php?name=Content&pa=showpage&pid=6
 
View user's profile Send private message Visit poster's website
alien73
PostPosted: Tue Feb 10, 2009 3:03 pm Reply with quote

darn it it didn't print the code right. where you see contentid-6.html use the full url instead
 
spasticdonkey
PostPosted: Tue Feb 10, 2009 3:45 pm Reply with quote

tried a couple different variations of that with no luck, actually with no effect.... not even a 500 error Sad
 
alien73
PostPosted: Tue Feb 10, 2009 3:48 pm Reply with quote

ummm I use it all the time and it works for me..

1. Are you using shortlinks?
2. RewriteRule ^yournewpage.html modules.php?name=........................etc...
 
Misha
PostPosted: Tue Feb 10, 2009 3:57 pm Reply with quote

Use spaces strategically Alien, to get the code displayed Smile

In that truncated version I don't see what you meant...
 
alien73
PostPosted: Tue Feb 10, 2009 4:03 pm Reply with quote

sorry I don't use phpbb. Normally when you use the code feature it should display without adding spaces. Just my experience with other forum software.
 
Misha
PostPosted: Tue Feb 10, 2009 4:10 pm Reply with quote

Well, it's not phpbb I think, it's Raven NUke Smile

I don't remember that strict filtering even on other Nuke versions Smile

Anyway, if you use modules.php in your code, try to break it by a space, that should do the trick
 
spasticdonkey
PostPosted: Tue Feb 10, 2009 4:11 pm Reply with quote

Ya I'm using shortlinks. I don't think you can shortlink the same url more than once though, and since it's defined earlier, no effect... Is re-writing the URL really going to forward me to the correct page in a totally different module anyway? Doesn't it just change the name of the URL? For instance, I could upload a blank index page named content-6.html to my html directory, but it would never load since the site actually pulls up modules.php ?name=Content&pa=showpage&pid=6 not content-6.html
alien73 wrote:
sorry I don't use phpbb. Normally when you use the code feature it should display without adding spaces. Just my experience with other forum software.

I think this re-writes on this site will change the code at times, it's shortlink related, thats why the spaces Smile
 
alien73
PostPosted: Tue Feb 10, 2009 4:30 pm Reply with quote

What's up with all the "I think, Don't think" killing me
 
alien73
PostPosted: Tue Feb 10, 2009 4:39 pm Reply with quote

spasticdonkey, Did a simple custom module to replace a content page, and was wondering the correct way to forward a shortlink'd URL?

Like in the movie Christmas vacation... Eddie said Are you serious Clark!

One question why do it like this anyways? Maybe the flu I currently have is getting to me. Just rewrite the url the custom module you wrote...
 
spasticdonkey
PostPosted: Tue Feb 10, 2009 5:26 pm Reply with quote

Yes I have shortlinked the new module, are you suggesting I change the new module to use the content-6.html URL???

mod_rewrite does have a redirect [R] but I don't know how to use it Embarassed

Quote:
'redirect|R [=code]' (force redirect)
Prefix Substitution with Only registered users can see links on this board! Get registered or login! (which makes the new URL a URI) to force a external redirection. If no code is given a HTTP response of 302 (MOVED TEMPORARILY) is used. If you want to use other response codes in the range 300-400 just specify them as a number or use one of the following symbolic names: temp (default), permanent, seeother. Use it for rules which should canonicalize the URL and give it back to the client, e.g., translate ``/~'' into ``/u/'' or always append a slash to /u/user, etc.
 
evaders99
PostPosted: Tue Feb 10, 2009 8:49 pm Reply with quote

If I remember correctly
[L]
is the postfix for the last Rewrite, thus it stops processing
 
Misha
PostPosted: Tue Feb 10, 2009 8:54 pm Reply with quote

evaders99 wrote:
If I remember correctly
[L]
is the postfix for the last Rewrite, thus it stops processing

Well, I expected this behavior, too - and it is listed in the manual. Yet for some reason it doesn't...
 
alien73
PostPosted: Tue Feb 10, 2009 9:07 pm Reply with quote

Did you create a GT-custommodule.php file for Shortlinks? Did you also put the code in .htaccess

This shouldn't be so complicated... You know you also can log into your google account and add, change or delete pages so google knows what to index from your site. Sitemap baby!!!
 
Misha
PostPosted: Tue Feb 10, 2009 9:59 pm Reply with quote

Alien, thanks, but you don't seem to understand the problem

We ARE talking about .htaccess. And sitemap or goodle account don't have anything to do with our problem either.

Can't say for spasticdonkey for sure, but I suspect his problem is pretty much like mine.

So you better understand, let me describe mine. I was building links to this content-11.html page for a couple of years, but now I want a more SEO-friendly url for it. I can't just delete it in google webmaster, I lose two years of work this way - and Yahoo and MSN don't care. I can't just make another entry in .htaccess either, cause this will create a duplicate content and still won't utilise two years worth of links. I have to make a 301 redirect for it. Do you follow now?
 
alien73
PostPosted: Tue Feb 10, 2009 10:38 pm Reply with quote

Misha: So you better understand, do you follow now.... :>) wow I'm impressed by your vocabulary.


First of all content-11.html is a Friendly URL next comes your pages meta keywords, then title, then your meta description.. Depending on what kind of links your building you may just give you a lower ranking anyways. Sorry but your logic makes no sense.


If you have any other questions feel free to ask someone else rudely:/\:
 
Misha
PostPosted: Tue Feb 10, 2009 11:34 pm Reply with quote

I actually did not mean to be rude, this happens to people for whom English is not a native language. I apologize if I did sound rudely.

Do you have anything constructive to say about the solution?
 
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17077

PostPosted: Wed Feb 11, 2009 12:45 am Reply with quote

Alien73 -> Smack ROTFL

Misha! Long time my friend Cheers . Other than meeting Alien73 boxing how goes it?

Deleted by Raven after he discovered he had misread Misha's post - Sorry!

I'll try it again in the morning after some sleep!
 
View user's profile Send private message
Raven
PostPosted: Wed Feb 11, 2009 12:56 am Reply with quote

Misha - I have edited my previous post. I need sleep and then I'll try again Laughing
 
Raven
PostPosted: Wed Feb 11, 2009 1:04 am Reply with quote

Okay, try researching this page Only registered users can see links on this board! Get registered or login! and look at this section.

'next|N' (next round)
Re-run the rewriting process (starting again with the first rewriting rule). This time, the URL to match is no longer the original URL, but rather the URL returned by the last rewriting rule. This corresponds to the Perl next command or the continue command in C. Use this flag to restart the rewriting process - to immediately go to the top of the loop. Be careful not to create an infinite loop!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> ShortLinks/TegoNuke

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©