Tag Info

Hot answers tagged

3

For your first two rewrites (non-www → www, http → https), the following rule should work: RewriteEngine On RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} !=www.example.com [NC] RewriteRule ^(.*) https://www.example.com/$1 [NS,L,R=permanent] Just replace www.example.com with the actual canonical hostname of your site. As for your third ...


1

Perfectly fine to 301 redirect all HTTP pages to their HTTPS equivalent. Either via httpd.conf on Apache servers, .htaccess rewrites or with a PHP include like your example. Any inbound links would pass about 97% of weight through a 301 redirect. The best handling internally would be to not use the protocol for internal linkage so that compatibility is ...


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


1

If they want content on the sites they own they should put unique content on it. One page is enough. Much better than 302ing to your site.


1

I need to double check the specifications, but I am pretty certain that cached objects depend on the request method. So an object using HTTP would be a different cache entity from HTTPS. So if you are redirecting to HTTPS, there should be no prior cache data. Also, you may want to consider using lower cache periods and requiring validation prior to ...


1

I don't know about GoDaddy's error, other than maybe it is expecting example.com rather than www.example.com (although I doubt it)?! You don't actually need to specify the host if redirecting on the same site? But anyway, this is easy to do in your root .htaccess file using mod_alias: Redirect 301 /oldpage.html /new-page.html (This assumes Apache 2.2.6+ ...


1

Would this be done on the internal IIS web server I assume you're using IIS. It's possible with IIS. There are several ways. I will show the way where you use the web.config file. In your web.config file put the following code: <rewrite> <rules> <rule name="Redirect domain.com to www" patternSyntax="Wildcard" ...


1

I am assuming that you still want requests that look like: http://www.parsilatex.com/joomla/index.php/1391-09-23-16-04-58 ...to still work. If this is not the case, please leave a comment and I will update the answer. I have not tested this here, but try: RewriteEngine On RewriteCond %{REQUEST_URI} $/joomla/index\.php^ [NC] RewriteRule .* ...


1

I had to ask this question myself. It is surprisingly tricky to do. Olaf Dietsche provided the solution of using an environment variable: RewriteRule ^contact$ contact.php [L,E=CLEAN_CONTACT_URL:1] RewriteCond %{ENV:REDIRECT_CLEAN_CONTACT_URL} !1 RewriteRule ^contact\.php$ /contact [R=301,L] That way the redirect only gets executed when contact.php is ...


1

Yes you would. You are telling Apache to take any reference to contact and rewrite the URI to contact.php then telling Apache to take any contact.php reference and change it to /contact which gets captured again by the first rule. Here is what you are missing. For each rewrite or redirect, Apache makes the change then starts the whole matching process over ...


1

This should do it. RewriteEngine On RewriteRule social(.*) https://twitter.com$1 [R=301,L]


1

You have two choices. You allow Internet traffic on port 443 on the machine within the internal network. Something your sysadmins might now want you to. If you don’t have sysadmins, please don’t :) Re-use another already server already exposed to the Internet. This is what we call a "Proxy", a fancy term to say "server for". There are many ways to ...



Only top voted, non community-wiki answers of a minimum length are eligible