PDA

View Full Version : .htacess problems with relative paths


modreoko
August 2nd, 2007, 23:20
Hi there,
I have one problem with rewrite rules. I have set up one simple rewrite rule where I would like to user relative path. it works in other servers, but mine.

here is the example:

Options Indexes
Options FollowSymLinks
RewriteEngine on

RewriteRule ^message/([^/]+)$ /index.php?Message=$1 [QSA,L]
#this does not work, but it should. it owrks in other servers....

RewriteRule ^message/([^/]+)$ http://domain/index.php?Message=$1 [QSA,L]
#this works, but it is not exactly ehat I need - it redirects to #another site

The other thing I realized is, that the browser can't go even back. I have to restart the browser.

thanx for help,
ivan

inimino
August 3rd, 2007, 00:44
The RewriteRule pattern matches against the absolute path from the HTTP request URI. Absolute paths always begin with "/" so you need to match the "/" at the beginning of the pattern if you are going to use "^".

I don't see how the rules above would match any request.

modreoko
August 5th, 2007, 11:59
Thanx for advice.
I changed my .htaccess to:

Options Indexes
Options FollowSymLinks
RewriteEngine on
RewriteRule ^/member/([^/]+).htm$ /index.php?PageName=$1 [QSA,L]

but it does not work.
the URI:
http://videoalbum/member/sendpassword.htm
throws 404 error Page not found...

Do you have any other advice, how to solve my problem?

ivan

inimino
August 5th, 2007, 22:36
I can't follow your link, it looks like it is missing the TLD.

I can't see any reason why your RewriteRule as written now wouldn't work though.

modreoko
August 20th, 2007, 11:06
well.. the link above is a virtual directory on my developer machine, so you cannot see it.
I tried to find out some setting or whatever it can be.. but I did not find any solution for it. it should work, but it does not..

anyway thanx.

inimino
August 20th, 2007, 11:13
What is a virtual directory?