SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2009-07-24 05:33:50

angathan
Member
Registered: 2009-03-06
Posts: 12

htaccess redirect

Hi,

i have redirected using the following code.

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/(.*).htm
RewriteRule ^(.*).htm http://www.mysite.com/test/test.php?ho=$1 [L]

My requirement is to display test.php?ho=hi.htm as hi.htm . it displays properly on my site. but not on my localhost, how do i configure it? in my apache.

Offline

Help fund CrunchBang, donate to the project!

#2 2009-07-24 12:47:47

pitje
#! Junkie
From: me to you
Registered: 2009-02-10
Posts: 438
Website

Re: htaccess redirect

let's see, the first two things that come to mind:
- is mod_rewrite enabled on your localhost?
- are you using an exact copy of the .htaccess you have online? (that won't work, you have to edit the paths that are being used)

A lot of info about htaccess files can be found here


oh yeah? well, your momma dresses you funny and you need a mouse to delete files

Offline

#3 2009-07-24 13:17:39

Toolz
#! Die Hard
From: Asia
Registered: 2009-02-02
Posts: 937

Re: htaccess redirect

I'm sure you should be escaping the dot in .htm however you say it's working as is so I'm not sure.

Note you might want to have an end anchor ($) after htm to avoid unanticipated results. Also indicate what kind of redirect you're aiming to achieve.

You'll have to check your .conf to make sure .htaccess files are being read at all. Have you got any other directives (DirectoryIndex, whatever) in there so you can show the .htaccess is being read?

Offline

#4 2009-07-24 13:33:34

Toolz
#! Die Hard
From: Asia
Registered: 2009-02-02
Posts: 937

Re: htaccess redirect

Scrub that...

Last edited by Toolz (2009-07-24 13:40:00)

Offline

#5 2009-10-04 15:20:27

angathan
Member
Registered: 2009-03-06
Posts: 12

Re: htaccess redirect

you can look at these links for example

http://w3calculator.com/math-tutorial/h … mbers.html

The redirect works fine, but the url on the address does not seems to be so. The url is shown as

http://www.w3calculator.com/math-tutori … dd-numbers

What would be the issue. I have searched for hours and days to fix this. Any idea.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo