Author |
Message |
spasticdonkey
RavenNuke(tm) Development Team

Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA
|
Posted:
Mon Feb 09, 2009 6:57 pm |
|
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...
www.mysite.com/mynewpage.html?name=Content&pa=showpage&pid=6
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? |
|
|
|
 |
Guardian2003
Site Admin

Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Mon Feb 09, 2009 7:37 pm |
|
Where you place the redirect in the htaccess file might have some affect, it should preferably be after all other rules. |
|
|
|
 |
evaders99
Former Moderator in Good Standing

Joined: Apr 30, 2004
Posts: 3221
|
Posted:
Mon Feb 09, 2009 7:52 pm |
|
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! |
|
|
 |
Misha
Worker


Joined: Jul 30, 2006
Posts: 205
Location: McLean, VA
|
Posted:
Tue Feb 10, 2009 11:19 am |
|
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! |
|
|
 |
spasticdonkey

|
Posted:
Tue Feb 10, 2009 2:04 pm |
|
ya i worked on it for awhile with no luck
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


Joined: Sep 15, 2008
Posts: 352
|
Posted:
Tue Feb 10, 2009 2:58 pm |
|
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 |
|
|
|
 |
alien73

|
Posted:
Tue Feb 10, 2009 3:03 pm |
|
darn it it didn't print the code right. where you see contentid-6.html use the full url instead |
|
|
|
 |
spasticdonkey

|
Posted:
Tue Feb 10, 2009 3:45 pm |
|
tried a couple different variations of that with no luck, actually with no effect.... not even a 500 error  |
|
|
|
 |
alien73

|
Posted:
Tue Feb 10, 2009 3:48 pm |
|
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

|
Posted:
Tue Feb 10, 2009 3:57 pm |
|
Use spaces strategically Alien, to get the code displayed
In that truncated version I don't see what you meant... |
|
|
|
 |
alien73

|
Posted:
Tue Feb 10, 2009 4:03 pm |
|
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

|
Posted:
Tue Feb 10, 2009 4:10 pm |
|
Well, it's not phpbb I think, it's Raven NUke
I don't remember that strict filtering even on other Nuke versions
Anyway, if you use modules.php in your code, try to break it by a space, that should do the trick |
|
|
|
 |
spasticdonkey

|
Posted:
Tue Feb 10, 2009 4:11 pm |
|
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  |
|
|
|
 |
alien73

|
Posted:
Tue Feb 10, 2009 4:30 pm |
|
What's up with all the "I think, Don't think"  |
|
|
|
 |
alien73

|
Posted:
Tue Feb 10, 2009 4:39 pm |
|
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

|
Posted:
Tue Feb 10, 2009 5:26 pm |
|
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
Quote: | 'redirect|R [=code]' (force redirect)
Prefix Substitution with http://thishost[:thisport]/ (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

|
Posted:
Tue Feb 10, 2009 8:49 pm |
|
If I remember correctly
[L]
is the postfix for the last Rewrite, thus it stops processing |
|
|
|
 |
Misha

|
Posted:
Tue Feb 10, 2009 8:54 pm |
|
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

|
Posted:
Tue Feb 10, 2009 9:07 pm |
|
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

|
Posted:
Tue Feb 10, 2009 9:59 pm |
|
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

|
Posted:
Tue Feb 10, 2009 10:38 pm |
|
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

|
Posted:
Tue Feb 10, 2009 11:34 pm |
|
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: 17088
|
Posted:
Wed Feb 11, 2009 12:45 am |
|
Alien73 ->
Misha! Long time my friend . Other than meeting Alien73 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! |
|
|
|
 |
Raven

|
Posted:
Wed Feb 11, 2009 12:56 am |
|
Misha - I have edited my previous post. I need sleep and then I'll try again  |
|
|
|
 |
Raven

|
Posted:
Wed Feb 11, 2009 1:04 am |
|
Okay, try researching this page http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html 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! |
|
|
|
 |
|