Tag Info

New answers tagged

1

It took a bit of reading and a lot of trail and error to get right but with the help of http://stackoverflow.com/questions/7218164/multiple-rewriterules-for-single-rewritecond-in-htaccess and also a few other sites (listed at the end) this is my solution which seems to work in enough cases to satisfy me. RewriteCond %{HTTP_REFERER} www.lordmatt.co.uk [OR] ...


1

There is one simple way of doing this: First: Create the redirects. Redirect permanent /articles/old-article-1.html http://www.example.com/articles/new-article.html Redirect permanent /articles/old-article-2.html http://www.example.com/articles/new-article.html Second: Rename old articles so that you can link to them. > mv old-article-1.html ...


3

I was serving my static files using Django while my media files using Apache. Serving my static files through Apache solved this issue.


0

That approach should work fine so long as your Apache config is setup so your application is listening on both ports 80 and 443 However, the original requests will show a warning about not have a valid SSL certificate. See the answer E Carter Young linked to in his comment if you need to avoid that.


0

In my case the changing AllowOverride None to AllowOverride All in /etc/apache2/sites-enabled/000-default.conf helped. All other .conf files have already had AllowOverride All.


2

All of the resources listed are third party ones and are externally hosted. You have no control over the caching headers sent by these URLs. You might be able to find advice specific to these scripts if you hunt around a bit, but in all likelihood you won't be able to improve your page speed score for this beyond what you're currently getting.


1

For internal links, links within your site, you should try to keep it dofollow. So that spider of the search engine can easily crawl each and every pages of your website. I hope you have enabled the Nofollow post status, that's why it makes each link of your post as nofollow. So change the status of "WP Nofollow Post Status" as disable.


5

No this is not good. Google did not intend for nofollow to be used for internal links. It is meant to be used for links that you do not have editorial control over. This is going to hurt you a lot. Your .htaccess code is not adding nofollow to your links. It is not possible for .htaccess to alter your HTML like that. Something else is causing your problem. ...


1

You can do this with a single RewriteRule. The trick here is to only check for valid username characters, not everything (ie. .* - I wouldn't have thought your usernames could literally be anything?). This would also be more efficient since not every request will match and be processed. For example, assuming your usernames can only consist of ...


1

Problem fixed through one heck of a lot of perseverance. I really should take the time to learn all of mod_rewrite at some point in time… In short I solved the redirect loop with the following condition: RewriteCond %{REQUEST_URI} !^/remote.php/ The above condition basically matches everything that isn't remote.php/ANYTHING_HERE I then used the above ...


0

User utrecht on serverfault posted this answer: The following has been tested on Scientific Linux: <VirtualHost *:80> DocumentRoot "/var/www/html/siteA" Alias /siteB/ "/var/www/html/siteB/" <Directory "/var/www/html/siteB/"> Order allow,deny Allow from all AllowOverride All </Directory> Alias /siteC/ ...


2

Your DNS example is missing a few elements. Here is how I would set things up. example.com A 10.0.11.101 www CNAME example.com sub-domain CNAME example.com www.sub-domain CNAME example.com If all are on a single web server, then the web server will take the request header and respond to the request accordingly. In this case, only your parent domain needs ...


0

This is really something that the hosting ISP should re-point on their end: <VirtualHost *:80> ServerName www.mysubsite.com DocumentRoot /path/to/projects/mysubsite </VirtualHost> You might be able to fix it in .htaccess: RewriteCond %{HTTP_HOST} ^www\.mysubsite\.com [OR] RewriteCond %{HTTP_HOST} ^mysubsite\.com RewriteRule ^(.*) ...


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 ...


2

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 ...



Top 50 recent answers are included