English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

VirtualHost and RewriteRule are in conflict, maybe?
i Have this URI = http://www.classicjewelry.com/diamondjewelry/product_detail.php/pid=197~subid=59/index.html

The /diamondjewelry/ is set by VirtualHost file as an Alias, so it not realy exists.

I tried add .htaccess to that physical folder it alias to say just turn http://classicjewelry.com/diamondjewelry/...

to

http://www.classicjewelry.com/diamondjewelry/...

and failed. It works only on the root:

RewriteCond %{HTTP_HOST} ^classicjewelry\.com$ [NC]
RewriteRule ^(.*)$ http://www.classicjewelry.com/$1 [R=301,L]

What to do?


Options +FollowSymLinks
RewriteEngine On

RewriteCond %{HTTP_HOST} ^classicjewelry.com/diamondjewelry/ [NC]
RewriteRule ^(.*)$ http://www.classicjewelry.com/diamond_jewelry/$1 [R=301,L]

2006-08-14 10:01:53 · 2 answers · asked by Martin G 2 in Computers & Internet Programming & Design

2 answers

mod-rewrite should be able to be set on any level (server, virtual host, directory, .htaccess). The problem is probably because you are going between subdomains (. to www.) This may not (and I haven't tested it) work on the virtual host level.

I recommend, if you are using multiple virtual hosts that need a similar command to use regular expressions instead of hard coding the url it is looking for and redirect with that.

for more info (if you don't have the link) http://httpd.apache.org/docs/2.0/mod/mod_rewrite.htm

2006-08-14 10:10:35 · answer #1 · answered by John J 6 · 0 0

rewriteConds practice in uncomplicated words to the only rewriteRule that follows them. So, the 2d rule is unconditional and that code will forbid all get admission to to the server. also, the server will loop attempting to serve the custom 403 blunders rfile.

2016-11-25 01:06:14 · answer #2 · answered by ? 4 · 0 0

fedest.com, questions and answers