Tag Info

New answers tagged

0

put this in .htaccess file in you're demo.example.com directory: RewriteEngine On RewriteCond %{HTTP_HOST} ^demo\.example\.com [NC] RewriteRule (.*) http://example.com/demo/$1 [L,R=301] i.e: demo.example.com is in folder root-folder/demo put that .htaccess file on folder demo, not on root-folder. hope this work for you.


1

What is the purpose of the redirect? The 301 Canonical The purpose of your redirect is to assure a canonical domain name. As such, the appropriate HTTP response is a 301. By default, many browsers will cache this indefinitely unless you specify a Cache-Control header. The 302 Confusion In the Google reference you provide, they are talking about landing ...


1

The type of redirect you are using is not the problem. 301 redirects are cacheable. In fact they are extremely hard to cache bust. 301 means "permanent" and browsers are very likely to cache 301 redirects with no way with the server to undo one that is already cached. 302 redirects are generally not cached by default unless other headers indicate that ...


0

CDN servers are configured to serve the resource if they already have a copy. If they don't have a copy, they need to fetch it from your website. To do so, they need to know what the address of your server is. You would have told them this information during the setup process for the CDN. It seems likely to me that the CDN is set up to fetch content from ...


1

You should only serve very generic error page to the user, as providing more details on error may disclose highly valuable information for malicious attacker. However you need more information for debugging. There are following solutions: Log all error information rather than just responding with it. This is good for production servers as allows to ...


2

It depends on your situation. Your PHP could also handle the lack of database connection in a nice way. But if you have a custom PHP with many possibilities for bugs and problems, go for an HTML page. If you're using a system such as Drupal or WordPress it's best to go with whatever is provided there, possibly adding something such as a module such as ...


3

This really depends on the error being served. For a 404 error, there would be no reason that there are any issues with the server - meaning all the php stuff should be working find. But if you have a 500 there may be an issue with the server, preventing php from running. This really depends on your tolerance for risk.


3

I would say yes, simply because there isn't any need for dynamic error pages. For example: If your database is down or under pressure, it is unlikely that you will want your error pages to be attempting database connections. Likewise, if your server is under pressure, you don't want your error pages to be carrying out any server-side processing. All-in-all, ...


0

I assume that this <img src="img/image.jpg" /> is in some subpage of your site, like http://www.example.com/page1/. The problem here is that you are using a directory relative URL for your image, so your browser will try to fetch http://www.example.com/page1/img/image.jpg, because it simply appends the relative URL to current page URL. However, since ...


1

I think the following mod_rewrite directives should do what you require, however, whether they do anything at all may be dependent on your configuration. RewriteEngine on RewriteCond %{QUERY_STRING} rsform RewriteRule ^joomla/(.+)$ http://watervriendengeleen.nl/formulieren/$1 [L,R=301] This redirects all requests for files in your /joomla/ subfolder, ...


0

While searching through out the internet, i got this link. http://stackoverflow.com/questions/13875273/dynamic-subdomain-with-htaccess-not-redirect Here is the solution i got RewriteCond %{HTTP_HOST} !^www.domain.com RewriteCond %{HTTP_HOST} ([^.]+).domain.com [NC] RewriteRule ^/?$ /member.php?username=%1 [L] RewriteCond %{HTTP_HOST} !^www.domain.com ...


1

Wildcard VirtualHost You can use a wildcard VirtualHost statement. <VirtualHost *:80> DocumentRoot /path/to/doc/root ServerName *.domain.com </VirtualHost> If you have a specific host, e.g. www.domain.com, put its VirtualHost stanza above the wildcard one. Apache works on a first match basis. Also, you may want to add: ...


2

Are you talking about sharding? Look at "Advanced Apache Rewriting" - at least probably your solution will use a RewriteMap .. although you do say dynamically, I still assume your list of users is static. RewriteMap Apache Documentation should be the way to go - you put your mapping in a text file like so: Ralf.S.Engelschall rse # Bastard Operator From ...


0

You can log into google webmaster tools and re-index your site. Found that is speeds up the process.


2

You can't check for the query string using the RewriteRule pattern (the query string is stripped before pattern matching, as is the hostname, etc). So, the rules you stated above simply won't match and you'll get a 404. However, you can use the RewriteCond directive to check the query string: For example: domain.tld/en/abc.php?foo to ...



Top 50 recent answers are included