Forum Moderators: phranque
I have 1 no-ip account
When client go on [example.no-ip.com...]
arrive on my local machine
I need to "redirect" people that come from there into a dir specific
So, I have write this on my .htaccess file :
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.no-ip.com.*
RewriteRule ^/$ /mydir/myfile.php [L]
BUT return Internal Server Error..
why? :(
/usr/local/apache/domains/example.no-ip.com/
<Directory /usr/local/apache/domains>
(bunch of other directives)
AllowOverride FileInfo (likely some other overrides)
</Directory>
<Directory />
Options FollowSymLinks
AllowOverride FileInfo
</Directory>
----this :----
<Directory "C:/Web" />
Options FollowSymLinks
AllowOverride FileInfo
</Directory>
----and this----
<Directory C:/web/>
Options FollowSymLinks
AllowOverride FileInfo
</Directory>
not to all :(
[Sun Mar 27 17:54:49 2005] [alert] [client 81.74.98.19] c:/web/.htaccess: Invalid command '//RewriteCond', perhaps mis-spelled or defined by a module not included in the server configuration
in the httpd.conf I have this :
<Directory c:/Web >
Options FollowSymLinks
AllowOverride FileInfo
</Directory>
in my .htaccess i have this :
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.no-ip.com.*
RewriteRule ^/$ /mydir/myfile.php [L]
When I digit http//example.no-ip.com I see c:/web root, now I don't obtain error but I'm not redirect into /mydir/myfile.php
? why?
Is rewrite only system or I can try to obtain same service for mw with virtual host?
Thks
You may need to place AllowOverride FileInfo Options before trying to use the Options directive.
<Directory c:/Web >
AllowOverride FileInfo Options
Options FollowSymLinks
</Directory>
If you want to comment-out a line in httpd.conf or .htaccess, use "#", not "//".
//RewriteCond
# RewriteCond
Jim
While
RewriteRule ^/ab$ /bc [L] will work in the main serverConfig-Section and in virtualhosts-Containers in httpd.conf (per-server context), it will not work in .htaccess files or within <Directory> or <location>-Containers in httpd.conf (per-dir context). For per-dir context, you'll have to use RewriteRule ^ab$ /bc [L], because the leading slash is already striped in this step of processing. > But I'm not redirect :(
In this case you specified an internal redirect (= URL does not change in the location bar)
To catch your request of example.no-ip-com/ you can use:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)example\.no-ip\.com
RewriteRule ^$ /mydir/myfile.php [L]
with this :
RewriteCond %{HTTP_HOST} ^example\.no-ip\.com
RewriteRule ^$ /mydir/myfile.php [L]
client is correct redirect ..
thks
Now problem is refer : link is broken and image is not display, because example.no-ip.com is not really a url base .. but is example.no-ip.com/mydir/
what can I do?
thks
I can modify more pages .. and there is a problem with navigation in localhost ..
Can I set document root!= only for client that arrived with [example.no-ip.com?...]
thks thks
So I can resolve url relative/absolute problem