|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Hello,
I know that you can use .htaccess with windows apache server. I got the htaccess to work too but having a wierd problem with .htaccess redirection. Here is the problem: My htaccess file: redirect / http://google.com Website: http://127.0.0.1:81/kevin This should redirect to google but when i go to the page, its redirects to http://google.comkevin/ Do you guys know what to do. I am clueless about this error. Thanks, Kevin |
|
#2
|
||||
|
||||
|
There's a chance Apache isn't even reading the htaccess file.
Have you enabled htaccess in the httpd.conf? AllowOverride All |
|
#3
|
|||
|
|||
|
Hey,
Thanks for replying. I did set that but i still get the same thing. I am a novice at htaccess with apache, if someone could please led me through it, it would be great. I tried reading on apache htaccess, but i dont know, its not working. ![]() |
|
#4
|
|||
|
|||
|
kevin this is an easy error to fix. first off you don't need your ipaddress or any form of the address within the script. you have part of it right but this is the best way to achieve the results you're seeking. these two lines will work
redirect /index.hml http://www.google.com/ or redirect / http://www.google.com/ your best bet would be to put your index page within the script, so if your main index page is kevin.php put that following the foward slash / and then the address to google. there it should work. ![]()
__________________
Apache Expert |
|
#5
|
|||
|
|||
|
ok it still doesn't work :-(
redirect /index.hml http://www.google.com/ = Just Doesn't redirect at all redirect / http://www.google.com/ = Redirects to http://google.com/kevin |
|
#6
|
|||
|
|||
|
do you have htaccess enabled as madcowdz suggested? also what operating system are you running?
|
|
#7
|
|||
|
|||
|
Hello,
Yes i do have AllowOverride All and i am running on windows XP. Let me post my apache conf htaccess part. Part 1: Code:
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
Part 2: Code:
#
# AccessFileName: The name of the file to look for in each directory
# for access control information. See also the AllowOverride directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
Thats all i could find about htaccess. Any idea? I could paste more if you want. Thanks! P.S. I noticed something else. when i do: redirect /kevin/hello http://google.com It doesn't redirect all at - not even to http://google.comkevinhello |
|
#8
|
|||
|
|||
|
that's funny, because on my windows server i have apache installed and tried this code, and i was sent straight to google.com when i ran it on my server.
what version of apache are you running on your xp machine? ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Web Server Configuration > Help with .htaccess |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|