User login

Permanent redirect on home web address only, leaving archive

Hey all, contrary to Agaric's usual pain-before-gain approach, here is the answer we eventually found up top:

RedirectMatch ^/$ http://example.com/e/www/

RedirectMatch, not RedirectRule, to go to a new site, is the little-known secret.

So that's why none of this worked:

# RewriteRule ^/ http://coanews.freespeech.org/ [R=permanent,L]
# RewriteCond %
# RewriteRule ^/$ http://coanews.freespeech.org/ [R=permanent,L]
# RewriteRule ^coanews.org$ http://coanews.freespeech.org/ [R=permanent,L]
RedirectMatch ^/$ http://coanews.freespeech.org/

forward only front page
tikiwiki permanent 301 redirect front page
Apache only redirect the home page
Apache redirect only / not other pages

TikiWiki CMS Apache 301 redirects:
http://www.webmasterworld.com/apache/3323475.htm

Complex, but not what we're after:
http://www.webmasterworld.com/apache/3300757.htm

Detailed, but also not our answer:
http://www.yolinux.com/TUTORIALS/LinuxTutorialWebSiteConfig.html#HTTPD

I think this is supposed to work the same in .htaccess:

File: httpd.conf
RewriteEngine On
RewriteRule /.* http://www.new-domain.com/ [R]

http://www.yolinux.com/TUTORIALS/ApacheRedirect.html

From other sources I think I can add a 301 after that R. If I leave off the .*, will it redirect only the unadorned front page?

More what we're looking for:

Apache 301 redirect using the .htacess file:
If one wants to permanently forward an entire web site to a new URL or forward a single page permanently and have the search engines update their database, one should use a 301 redirect. This may redirect to a new server or to inself but to a different domain. This tutorial shows how. This method is a variation of using the mod_alias redirection shown above except that it allows the customer to redirect themselves by providing a .htacess file themselves.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yolinux.com
RewriteRule ^(.*)$ http://www.yolinux.com/$1 [R=permanent,L]

So unlike these just above, here's what proved useful– the Apache documentation, of course.

http://httpd.apache.org/docs/2.0/rewrite/rewrite_guide.html

Didn't actually need the advanced documentation, just an unusual use of an off-hand reference to RedirectMatch, above.

http://httpd.apache.org/docs/2.0/rewrite/rewrite_guide_advanced.html

First, all Redirects are processed before Aliases are processed, and therefore a request that matches a Redirect or RedirectMatch will never have Aliases applied. Second, the Aliases and Redirects are processed in the order they appear in the configuration files, with the first match taking precedence.

That explains that.

Hey all, contrary to Agaric's usual pain-before-gain approach, here is the answer we eventually found up top:

RedirectMatch ^/$ http://example.com/e/www/

RedirectMatch, not RedirectRule, to go to a new site, is the little-known secret.

So that's why none of this worked:

# RewriteRule ^/ http://coanews.freespeech.org/ [R=permanent,L]
# RewriteCond %
# RewriteRule ^/$ http://coanews.freespeech.org/ [R=permanent,L]
# RewriteRule ^coanews.org$ http://coanews.freespeech.org/ [R=permanent,L]
RedirectMatch ^/$ http://coanews.freespeech.org/

forward only front page
tikiwiki permanent 301 redirect front page
Apache only redirect the home page
Apache redirect only / not other pages

TikiWiki CMS Apache 301 redirects:
http://www.webmasterworld.com/apache/3323475.htm

Complex, but not what we're after:
http://www.webmasterworld.com/apache/3300757.htm

Detailed, but also not our answer:
http://www.yolinux.com/TUTORIALS/LinuxTutorialWebSiteConfig.html#HTTPD

I think this is supposed to work the same in .htaccess:

File: httpd.conf
RewriteEngine On
RewriteRule /.* http://www.new-domain.com/ [R]

http://www.yolinux.com/TUTORIALS/ApacheRedirect.html

From other sources I think I can add a 301 after that R. If I leave off the .*, will it redirect only the unadorned front page?

More what we're looking for:

Apache 301 redirect using the .htacess file:
If one wants to permanently forward an entire web site to a new URL or forward a single page permanently and have the search engines update their database, one should use a 301 redirect. This may redirect to a new server or to inself but to a different domain. This tutorial shows how. This method is a variation of using the mod_alias redirection shown above except that it allows the customer to redirect themselves by providing a .htacess file themselves.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yolinux.com
RewriteRule ^(.*)$ http://www.yolinux.com/$1 [R=permanent,L]

So unlike these just above, here's what proved useful– the Apache documentation, of course.

http://httpd.apache.org/docs/2.0/rewrite/rewrite_guide.html

Didn't actually need the advanced documentation, just an unusual use of an off-hand reference to RedirectMatch, above.

http://httpd.apache.org/docs/2.0/rewrite/rewrite_guide_advanced.html

First, all Redirects are processed before Aliases are processed, and therefore a request that matches a Redirect or RedirectMatch will never have Aliases applied. Second, the Aliases and Redirects are processed in the order they appear in the configuration files, with the first match taking precedence.

That explains that.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.