PHP Web Host - Quality Web Hosting For All PHP Applications Clan Themes! We make clans look good!!
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
spasticdonkey
RavenNuke(tm) Development Team


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

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

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 to the forums!


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
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

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

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 Visit poster's website
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

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

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
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 Back to top

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...
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team


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

PostPosted: Tue Feb 10, 2009 2:04 pm Reply with quote Back to top

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?
View user's profile Send private message
alien73
Involved
Involved


Joined: Sep 15, 2008
Posts: 352

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

Try this in your .htaccess file.. The only problem is it may loop since contentid-6.html is already rewritten through shortlinks

RewriteRule ^yournewpage.html contentid-6.html
View user's profile Send private message Visit poster's website
alien73
Involved
Involved


Joined: Sep 15, 2008
Posts: 352

PostPosted: Tue Feb 10, 2009 3:03 pm Reply with quote Back to top

darn it it didn't print the code right. where you see contentid-6.html use the full url instead
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team


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

PostPosted: Tue Feb 10, 2009 3:45 pm Reply with quote Back to top

tried a couple different variations of that with no luck, actually with no effect.... not even a 500 error Sad
View user's profile Send private message
alien73
Involved
Involved


Joined: Sep 15, 2008
Posts: 352

PostPosted: Tue Feb 10, 2009 3:48 pm Reply with quote Back to top

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...
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 3:57 pm Reply with quote Back to top

Use spaces strategically Alien, to get the code displayed Smile

In that truncated version I don't see what you meant...
View user's profile Send private message Visit poster's website
alien73
Involved
Involved


Joined: Sep 15, 2008
Posts: 352

PostPosted: Tue Feb 10, 2009 4:03 pm Reply with quote Back to top

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.
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 4:10 pm Reply with quote Back to top

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
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team


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

PostPosted: Tue Feb 10, 2009 4:11 pm Reply with quote Back to top

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
View user's profile Send private message
alien73
Involved
Involved


Joined: Sep 15, 2008
Posts: 352

PostPosted: Tue Feb 10, 2009 4:30 pm Reply with quote Back to top

What's up with all the "I think, Don't think" killing me
View user's profile Send private message Visit poster's website
alien73
Involved
Involved


Joined: Sep 15, 2008
Posts: 352

PostPosted: Tue Feb 10, 2009 4:39 pm Reply with quote Back to top

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...
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team


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

PostPosted: Tue Feb 10, 2009 5:26 pm Reply with quote Back to top

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 to the forums!
(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.
View user's profile Send private message
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Tue Feb 10, 2009 8:49 pm Reply with quote Back to top

If I remember correctly
[L]
is the postfix for the last Rewrite, thus it stops processing
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 8:54 pm Reply with quote Back to top

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...
View user's profile Send private message Visit poster's website
alien73
Involved
Involved


Joined: Sep 15, 2008
Posts: 352

PostPosted: Tue Feb 10, 2009 9:07 pm Reply with quote Back to top

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!!!
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 9:59 pm Reply with quote Back to top

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?
View user's profile Send private message Visit poster's website
alien73
Involved
Involved


Joined: Sep 15, 2008
Posts: 352

PostPosted: Tue Feb 10, 2009 10:38 pm Reply with quote Back to top

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:/\:
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:34 pm Reply with quote Back to top

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?
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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 Visit poster's website AIM Address Yahoo Messenger
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Feb 11, 2009 12:56 am Reply with quote Back to top

Misha - I have edited my previous post. I need sleep and then I'll try again Laughing
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Feb 11, 2009 1:04 am Reply with quote Back to top

Okay, try researching this page
Only registered users can see links on this board!
Get registered or login to the forums!
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!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum