Submit Your Article Forum Rules

+ Reply to Thread
Results 1 to 6 of 6

Thread: Permanent Redirecting & The .htaccess File

  1. #1
    Member madjohn is an unknown quantity at this point madjohn's Avatar
    Join Date
    Feb 2007
    Posts
    37

    Question Permanent Redirecting & The .htaccess File

    Hi all!
    I hvae been using 301 redirects for all my old pages but have since found the power of the .htaccess file.

    Can I now dispense with my 301 HTML redirects since the .htaccess will handle this for me? What will the SEbots 'say' about that?

    Also, in my browser, the address of the redirected page is remaining as the old address;
    e.g. www.mydomain.com/contact.htm (old page) does not change to www.mydomain.com/contact.php (new page).

    And finally, I am on a Linux Web Server and so my directories that use capital letters need to be typed into the address bar using the exact syntax. So if you typed in www.mydomain.com/Contact.htm instead of www.mydomain.com/contact.htm the page would not show.
    How do I use the .htaccess to overcome this?

    If there is a resource website I could visit to find the answers that would be cool too!

  2. #2

    Re: Permanent Redirecting & The .htaccess File

    Hey John,

    I would do your best to handle the 301's through the .htaccess file. It take precedence over your HTML versions, and the bots treat it so.

    As for the URLs not reflecting, is this done in the .htaccess?

    And I know there is a way to play with caps in .htaccess, but if you don't have a big, giant site (like microsoft.com or ibm.com) take the lazy route and just redirect that too.

    While you're in there playing with your .htaccess, go ahead and make the decision on www. vs. no www. and trailing slashes. Might as well get that out of the way.
    Fast. Cheap. Quality. You can have any 2, but not all 3.
    SEO Factor's Small Business SEO Services

  3. #3
    Senior Member Jean-Luc has a spectacular aura about Jean-Luc has a spectacular aura about Jean-Luc has a spectacular aura about
    Join Date
    Dec 2007
    Posts
    212

    Re: Permanent Redirecting & The .htaccess File

    Quote Originally Posted by madjohn View Post
    I hvae been using 301 redirects for all my old pages but have since found the power of the .htaccess file.

    Can I now dispense with my 301 HTML redirects since the .htaccess will handle this for me? What will the SEbots 'say' about that?

    Also, in my browser, the address of the redirected page is remaining as the old address;
    e.g. www.mydomain.com/contact.htm (old page) does not change to www.mydomain.com/contact.php (new page).
    Your message is confusing.

    You speak about your "301 HTML redirects": this doesn't exist. You have either 301 redirects or HTML redirects, but not both at the same time.

    If the address in the address bar is remaining the old address, you don't have a 301 redirect, nor have an HTML redirect.

    Jean-Luc
    200ok.eu Broken Link Checker finds 404 errors, error pages with 200 ok status, missing images, protocol errors, password protected pages, bad domain names, redirect loops, parking pages, ...

  4. #4
    Senior Member activeco will become famous soon enough
    Join Date
    Jul 2004
    Posts
    913

    Re: Permanent Redirecting & The .htaccess File

    Quote Originally Posted by madjohn View Post
    Hi all!
    I hvae been using 301 redirects for all my old pages but have since found the power of the .htaccess file.
    You would be even more surprised of the power of http configuration files. .htaccess is recomended to use only if you don't have full access to your server.

    Also, in my browser, the address of the redirected page is remaining as the old address;
    e.g. www.mydomain.com/contact.htm (old page) does not change to www.mydomain.com/contact.php (new page).
    It depends of the rewriting way you used to do it.

    And finally, I am on a Linux Web Server and so my directories that use capital letters need to be typed into the address bar using the exact syntax. So if you typed in www.mydomain.com/Contact.htm instead of www.mydomain.com/contact.htm the page would not show.
    How do I use the .htaccess to overcome this?
    e.g.:
    RewriteRule ^([^A-Z]*[A-Z].*)$ http://www.yoursite.com/${lowercase:$1} [R=301,L]

    but under condition that your httpd.conf has lowercase function enabled: RewriteMap lowercase int:tolower

    If there is a resource website I could visit to find the answers that would be cool too!
    Sure: Apache mod_rewrite , but you could probably find some more easier to follow mod_rewrite manual on the web.
    Impossible? You just underestimate the time.

  5. #5
    Senior Member spiderbait has much to be proud of spiderbait has much to be proud of spiderbait has much to be proud of spiderbait has much to be proud of spiderbait has much to be proud of spiderbait has much to be proud of spiderbait has much to be proud of spiderbait has much to be proud of spiderbait has much to be proud of spiderbait has much to be proud of spiderbait's Avatar
    Join Date
    Oct 2003
    Posts
    268

    Re: Permanent Redirecting & The .htaccess File

    My favorite resource for .htaccess is the following site:

    .htaccess Help - 10 Best .htaccess Tutorials

    Hope it helps.
    Jade Burnside, Ahead of the Web
    What good is your web site if no one can find it?
    SEO & Optimized Web Site Design

  6. #6
    Member madjohn is an unknown quantity at this point madjohn's Avatar
    Join Date
    Feb 2007
    Posts
    37

    Thumbs up Re: Permanent Redirecting & The .htaccess File

    Thanks all!

    Quote Originally Posted by jgarner View Post
    As for the URLs not reflecting (the change from .htm to .php), is this done in the .htaccess?
    I think so, but how?
    The link spiderbait posted (thanks, by the way) shows how to change all files so they can look a certain filetype but does it matter to SEO if I do that, since most are .htm?

    Quote Originally Posted by jgarner View Post
    And I know there is a way to play with caps in .htaccess, but if you don't have a big, giant site (like microsoft.com or ibm.com) take the lazy route and just redirect that too.
    Yeah, my site is not huge but there are enough pages to redirect that it's time to start to use the .htaccess rather than the HTML redirects I have been using (and not 301 HTML redirects as I described earlier - thanks Jean-Luc ) and thus there are enough pages that I would rather just change case (as shown by activeco - thanks!) than have to employ a redirect on each one..!

    Quote Originally Posted by activeco View Post
    You would be even more surprised of the power of http configuration files. .htaccess is recomended to use only if you don't have full access to your server.
    I would? Cool. But what is that..!? I take it my webspace provider would tell me if I have full access...?

+ Reply to Thread

Similar Threads

  1. dot htaccess file
    By caneman in forum Webmaster Resources Discussion Forum
    Replies: 3
    Last Post: 02-18-2010, 09:39 PM
  2. redirecting dynamic urls in htaccess
    By caravan in forum Search Engine Optimization Forum
    Replies: 8
    Last Post: 12-11-2009, 03:11 PM
  3. Redirecting database generated pages from within .htaccess
    By LoveNotWar in forum Web Programming Discussion Forum
    Replies: 4
    Last Post: 01-04-2007, 02:01 AM
  4. help regarding .htaccess file
    By SES Trims in forum Search Engine Optimization Forum
    Replies: 1
    Last Post: 12-26-2006, 08:48 PM
  5. help regarding .htaccess file
    By SES Trims in forum Google Discussion Forum
    Replies: 3
    Last Post: 12-08-2006, 06:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts