Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 07 Aug 2008, 16:38
davide101 davide101 is offline
 
Join Date: Dec 2005
.htaccess riddle - guru needed!

I have some working .htaccess code (below). I would love to make this a [R=301] permanent redirect so PageRank is passed from our old links. When I simply add [R=301] to the last statement, it adds .php to hte urls.

.htaccess below: /headlines/
.htacess with R=301: /headlines.php/

Any ideas on how to do this properly? I'm not sure why the redirect changes the working rewrite.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
David Edelman
Diabetes Forum
Reply With Quote
  #2  
Old 07 Aug 2008, 20:37
Budget101 Budget101 is offline
 
Join Date: Jul 2008
here's a Link on how to do a Redirect:

http://www.vbulletin.com/forum/showthread.php?t=247241

and also to redirect from 1 forum to another:

http://www.vbulletin.com/forum/showthread.php?t=247216


hth

(And Mod's if linking to vb.com isn't allowed, would someone give me a holler and let me know! Thnx)
Reply With Quote
  #3  
Old 08 Aug 2008, 00:10
sockwater's Avatar
sockwater sockwater is offline
 
Join Date: Apr 2008
It's adding the .php because you have .php in your rewrite rule. No mystery about it.

Give me an example URL that you want to permanently redirect to another URL and I'll give you the rewrite rule.
Reply With Quote
  #4  
Old 08 Aug 2008, 02:10
davide101 davide101 is offline
 
Join Date: Dec 2005
Sockwater, I did a poor job explaining the problem. I'm not as slow as I look, I promise. I'm working with someone else's code and trying to understand exactly what's going wrong.

I have a file called headlines.php. With the .htaccess posted above, you can access it via:
http://www.diabetesdaily.com/news/headlines.php OR
http://www.diabetesdaily.com/news/headlines/.

Or you could access:
http://www.diabetesdaily.com/news/headlines/page/1 OR
http://www.diabetesdaily.com/news/headlines.php/page/1

If I make this a 301 redirect it goes to 404. If I remove the .php from the .htaccess file, I get a server error. If I add a 301 redirect and remove the .php, it goes to 404.

Ideally, I think I want to make the last line a 301 redirect AND redirect from headlines.php to headlines.

Is this more clear? I feel like I can follow the current .htaccess, but I'm at a total loss how to describe what I want to happen.
__________________
David Edelman
Diabetes Forum
Reply With Quote
  #5  
Old 08 Aug 2008, 05:22
sockwater's Avatar
sockwater sockwater is offline
 
Join Date: Apr 2008
I wasn't trying to imply you were slow..

I would do something like this, but it's kind of hard to tell, not knowing how your scripts work.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #6  
Old 08 Aug 2008, 14:45
davide101 davide101 is offline
 
Join Date: Dec 2005
That works perfectly for my specific example. Using my own brain power, I'm going to make a generic edition of that rewrite. Thanks for the assistance!
__________________
David Edelman
Diabetes Forum
Reply With Quote
  #7  
Old 08 Aug 2008, 15:43
sockwater's Avatar
sockwater sockwater is offline
 
Join Date: Apr 2008
To make it more generic, while still controlling the input, you could try something like this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #8  
Old 08 Aug 2008, 18:02
davide101 davide101 is offline
 
Join Date: Dec 2005
I got it working. We've been bouncing between the 5 and 7 spots on Google for "diabetes news" but have thousands of incoming links pointing at three different URLS. By consolidating them into one, we hope to jump towards number one. Thanks very much for your help as always.
__________________
David Edelman
Diabetes Forum
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 01:49.

Layout Options | Width: Wide Color: