Reply
Needing Help for a simple redirection
Old 07-07-2009, 06:40 AM Needing Help for a simple redirection
etrader's Avatar
Novice Talker

Posts: 12
Trades: 0
I need a .htaccess command to simply redirect

http://domain.com/index.php?somethin...ething=KEYWORD

to

http://domain.com/KEYWORD
__________________
FatCow Web Hosting
etrader is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 07-08-2009, 01:25 PM Re: Needing Help for a simple redirection
hairygunther's Avatar
Extreme Talker

Posts: 164
Trades: 0
Surely .htaccess files are only for security issues, not for redirecting things?

I think you need to either make changes to a configuration file somewhere (like httpd.conf, i think it is), or just stick some code in the php script (why not use a traditional url redirect? are we racist against url redirects? they work fine, why ignore them. I used one only the other day - it works brilliantly, as part of a sequence, by the end of which a user's cookies are fully loaded into the gun of commercial traffic).

I can't see any reason to believe .htaccess files can do anything similar to what you mention:
http://httpd.apache.org/docs/1.3/howto/htaccess.html

Try this...
<meta http-equiv="refresh" content="0;url=http://example.com/" />
Surely you can get the php script to put the appropriate link in where example.com/ is?

That's a few moments work. Doing it deeper down would definitely involve configuration files. And if it's that important, why not, but if it isn't, what's wrong with a meta refresh tag (which I apparently called a url redirect tag, earlier - just goes to show what it's primarily used for).
__________________
I acknowledge Parker out of Thunderbirds and Glaxo Industries.
hairygunther is offline
Reply With Quote
View Public Profile
 
Old 07-08-2009, 07:47 PM Re: Needing Help for a simple redirection
andrei155's Avatar
CEO of BLD Hosting

Latest Blog Post:
Cpanel Update
Posts: 1,340
Name: Andrei
Location: Canada
Trades: 6
Quote:
Originally Posted by hairygunther View Post
Surely .htaccess files are only for security issues, not for redirecting things?
Nope, it is quite capable of redirecting!
__________________
No Overselling Guarantee
Now Includes a Free Domain
BLD Hosting - Web Hosting | Web Hosting Blog
andrei155 is offline
Reply With Quote
View Public Profile Visit andrei155's homepage!
 
Old 07-08-2009, 08:13 PM Re: Needing Help for a simple redirection
etrader's Avatar
Novice Talker

Posts: 12
Trades: 0
Quote:
Originally Posted by andrei155 View Post
Nope, it is quite capable of redirecting!
I totally agree!

In CMS, .htaccess is used to create SEF (Search Engine Friendly) urls
__________________
FatCow Web Hosting
etrader is offline
Reply With Quote
View Public Profile
 
Old 07-09-2009, 06:09 PM Re: Needing Help for a simple redirection
hairygunther's Avatar
Extreme Talker

Posts: 164
Trades: 0
Shocking!

I decided to read about it:
http://www.mapelli.info/blog/htacces...fun-and-profit

Btw it's definitely bad form:
Quote:
When (not) to use .htaccess files

In general, you should never use .htaccess files unless you don't have access to the main server configuration file. There is, for example, a prevailing misconception that user authentication should always be done in .htaccess files. This is simply not the case. You can put user authentication configurations in the main server configuration, and this is, in fact, the preferred way to do things.

.htaccess files should be used in a case where the content providers need to make configuration changes to the server on a per-directory basis, but do not have root access on the server system. In the event that the server administrator is not willing to make frequent configuration changes, it might be desirable to permit individual users to make these changes in .htaccess files for themselves. This is particularly true, for example, in cases where ISPs are hosting multiple user sites on a single machine, and want their users to be able to alter their configuration.

http://httpd.apache.org/docs/2.2/howto/htaccess.html
And from the purely hacker point of view... whilst .htpasswd files are indeed strongly encrypted, protection in .htaccess files doesn't require rebooting to remove, or indeed restarting apache.

Still, you live and learn. I wish mint aeros tasted as good as they used to do when I was young.
__________________
I acknowledge Parker out of Thunderbirds and Glaxo Industries.
hairygunther is offline
Reply With Quote
View Public Profile
 
Old 07-09-2009, 06:22 PM Re: Needing Help for a simple redirection
hairygunther's Avatar
Extreme Talker

Posts: 164
Trades: 0
On further examination of the mapelli link I've thought about what a hacker would consider doing to you if he could mess around with an already-existent .htaccess file - the obvious thing is to redirect your users to his domain. His illegal untraceable viagra-selling domain of course, but his domain and not yours.

Yep, I just tested it out, you could definitely do that. And I learned how to do RewriteCond and RewriteRule both. What fun. This is definitely a tool to help hackers take away your traffic. Hackers? I mean crackers. But of course, to most people there is no attempt to discern or label correctly. Besides, labels are bad anyway.

cheers for the info
__________________
I acknowledge Parker out of Thunderbirds and Glaxo Industries.
hairygunther is offline
Reply With Quote
View Public Profile
 
Old 07-10-2009, 12:46 AM Re: Needing Help for a simple redirection
Lashtal's Avatar
PHP Learner

Posts: 492
Name: Lashtal
Trades: 0
Quote:
Originally Posted by hairygunther View Post
...His illegal untraceable viagra-selling domain of course...
lol, nice
Lashtal is offline
Reply With Quote
View Public Profile
 
Old 07-12-2009, 05:35 AM Re: Needing Help for a simple redirection
hairygunther's Avatar
Extreme Talker

Posts: 164
Trades: 0
Not everyone enjoys my humour sadly, Lashtal!

I love this quote from your site:

"Today is victory over yourself of yesterday; tomorrow is your victory over lesser men."- Miyamoto Musashi

__________________
I acknowledge Parker out of Thunderbirds and Glaxo Industries.
hairygunther is offline
Reply With Quote
View Public Profile
 
Old 07-12-2009, 01:57 PM Re: Needing Help for a simple redirection
andrei155's Avatar
CEO of BLD Hosting

Latest Blog Post:
Cpanel Update
Posts: 1,340
Name: Andrei
Location: Canada
Trades: 6
Quote:
Originally Posted by etrader View Post
Do you want a redirect, or a URL name rewrite?
__________________
No Overselling Guarantee
Now Includes a Free Domain
BLD Hosting - Web Hosting | Web Hosting Blog
andrei155 is offline
Reply With Quote
View Public Profile Visit andrei155's homepage!
 
Reply     « Reply to Needing Help for a simple redirection
 

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.15811 seconds with 13 queries