Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
How do I can download the default web page from a domain using wget ? Example:
www.mydomain.com returns index.html as default page and www.newdomain.com returns default.html as default page. So, using wget as wget [options] www.mydomain.com must download index.html and wget [options] www.newdomain.com must download default.html.
wget [options] www.mydomain.com/index.html
wget [options] www.newdomain.com/default.html
Wget supports filenames not just domain names.
You will never know what the default name of a file is (as a end user) only the server knows this. When you send a response to www.domain.com what the webserver for www.domain.com gets is GET / the webserver then looks in the / directory and discovers what the default file is (index.html, default.html or anything else the server admin has set as the default. You then just get sent that copy back. So you don't need to do anything as the end user to get the default page, it just happens by itself.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
My website on Debian 9 doesn't allow to download any .ini files located in any folders. How to allow downloading of .ini files at least from a specific folder using .htaccess?
You should ideally find where and how these files are being blocked as it may require additional steps to "unblock". However, you can try something like the following in the .htaccess file in the directory that you want to permit access to all .ini files:
<Files "*.ini">
Require all granted
</Files>
Update from OP:
In error.log I see the following:
ModSecurity: Access denied with code 403 (phase 2). Matched phrase ".ini/" at TX:extension.
I can solve this problem by adding a new directive for Apache:
<IfModule mod_security2.c>
SecRuleRemoveByTag CWAF
</IfModule>
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Is it possible to redirect local ipaddress to domain/subdomain name in linux?
I know it is possible with DNSMasq but my modem doesn't support that.
For testing locally, edit your /etc/hosts file to route subdomain.domain.com to localhost:
127.0.0.1 subdomain.domain.com
DNS will resolve requests to subdomain.domain.com to your local server.
Going the opposite direction, you can setup a reverse proxy to route localhost to a staging or production environment such as subdomain.domain.com. Edit httpd.conf or apache2.conf to include a ProxyPass.
For Apache, this requires mod_proxy module, loading modules proxy_module and proxy_http_module.
Of course, if you are not targeting specific environments, you could simply use relative paths.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have two servers A (192.168.1.100) and B(192.168.1.101) on my local network and one external IP. I would like to forward the HTTP request based on the sub-domains. For instance i would like to have any http request to a.example.com would go to server A 192.168.1.100 and any request to b.example.com go to server B 192.168.1.101. Is there any options that I can implement on Server A Apache configuration files to do this?
I think, this could be better handled by a router or an iptables rule.
This said, you could setup a virtual host entry on machine A, forwarding all requests to your second machine B
<virtualHost *:80>
ServerName b.example.com
RewriteEngine On
RewriteRule .* http://192.168.1.101$0 [P]
</VirtualHost>
The [P] flag forwards the requests to mod_proxy, so this must be enabled. Another caveat is the performance warning at RewriteRule Flags - P|proxy.
Last point, this is untested, so please be careful.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I would like to remove directory from URL. I have a page in mydomain.com/dir/ and all links works under mydomain.com/dir/link1.html, mydomain.com/dir/link2.html etc.
I would like to create single URL which will be mydomain.com/new_link and will trace to mydomain.com/dir/index.php?page=13. I would like it to do only once, for one link, not a regular expression. .htaccess file is located in dir directory with the following content:
RewriteRule ^new_link$ index.php?page=13 [L]
But this causes that the dir is still visible.
I do not entirely understand your question. From what I have understood,
if you want to remove dir from your URL, have your .htaccess in parent directory of dir. I think its the DocumentRoot in your case.
And add this RewriteRule:
RewriteRule ^new_link$ dir/index.php?page=13 [QSA,L]
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
i have a private section where specific users can login on my system (restricted to 4 users)
i want to add IP restriction in the .htaccess using:
<Limit GET POST PUT>
order allow,deny
allow from 127.0.0.1
allow from 192.168
allow from 67.xx.xx
# etc..
deny from all
</Limit>
but i get this error:
Forbidden
You don't have permission to access / on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
when i try to access this site locally (i have lamp on my desktop installed, my host file is setup correctly and my apache config is good too)
if I go to my site locally i can see my site with mod-rewrite and errordocument. everything is working fine
why do i get an access denied when i put the restrictin?
you can first deny and then allow:
order deny,allow
deny from all
allow from 127.0.0.1
allow from 192.168
allow from 67.xx.xx
# etc..
obviously I can not test with your setup, but that's what I do.