Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Closed Thread
How can htaccess be used to pass information to php script?
Old 04-26-2011, 05:20 AM Arrow How can htaccess be used to pass information to php script?
L a r r y's Avatar
Super Talker

Posts: 103
Name: Larry K
Location: Arizona
Trades: 0
Hello,
I am running a new web site and have chosen the no-www version, and have implemented it in my .htaccess.

All is fine, for http://www.myhobby.example.org goes to http://myhobby.example.org, with a 301 permanent redirect.

To accomplish this I use:
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^myhobby.example.org$ [NC]
RewriteRule ^(.*)$ http://myhobby.example.org/$1 [L,R=301]
I imagine, however, that webmasters are going to link to my site at www.myhobby.example.org and I get no link credit for these links, while others link to myhobby.example.org and I do get credit for their links, correct?

Anyway, I can change the RewriteRule to point to a different page on my web site, say,
Code:
RewriteRule ^(.*)$ http://myhobby.example.org/www/$1
but with some way to pass $1 to a php script there, which would first advise visitors that the correct link is http://myhobby.example.org/$1, then redirect them there.

The idea is, that a webmaster installs a new link, then tests it, and it says here "No WWW! The correct link here is http://myhobby.example.org/bowling/, to which you will be redirected. if your browser does not redirect you please click the link."

Thanks ever so much!
L a r r y is offline
View Public Profile Visit L a r r y's homepage!
 
 
Register now for full access!
Old 04-26-2011, 01:46 PM Re: How can htaccess be used to pass information to php script?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
I imagine, however, that webmasters are going to link to my site at www.myhobby.example.org and I get no link credit for these links, while others link to myhobby.example.org and I do get credit for their links, correct?
That's what the permanent redirect is FOR, other wise it wouldn't matter in the slightest for real visitors.

The redirect is ONLY for search engines to "transfer credit" to a single URI.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
View Public Profile Visit chrishirst's homepage!
 
Old 04-26-2011, 11:31 PM Re: How can htaccess be used to pass information to php script?
L a r r y's Avatar
Super Talker

Posts: 103
Name: Larry K
Location: Arizona
Trades: 0
Quote:
Originally Posted by chrishirst View Post
That's what the permanent redirect is FOR, other wise it wouldn't matter in the slightest for real visitors.

The redirect is ONLY for search engines to "transfer credit" to a single URI.
OK, so I DO get credit for links to the wrong side of www, whether I choose to be a www or a non-www site. Thanks Chris!
L a r r y is offline
View Public Profile Visit L a r r y's homepage!
 
Closed Thread     « Reply to How can htaccess be used to pass information to php script?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45748 seconds with 12 queries