Re: avoiding a redirect loop with rewrites

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Josh Trutwin wrote:
> On Thu, 22 Feb 2007 21:36:03 +0000
> matt farey <matt.farey@xxxxxxxxx> wrote:
>
>   
>> RewriteEngine On
>> ReWriteCond %{REQUEST_FILENAME} pid5.html$
>> ReWriteCond %{QUERY_STRING} !stop=yes
>> ReWriteRule . /products.html [R=301]
>> ReWriteRule ^products.html$ /pages/pid5.html?stop=yes [L,QSA]
>>     
>
> Thanks Matt - I'll give that a try to see if it fits the works.  I
> assume this would still work too if I wanted to be as specific as
> possible:
>
> ReWriteCond %{REQUEST_FILENAME} pages/pid5.html$
>
>   
>> I'll be embarrassed if it works, the easier way would be to let
>> your CMS handle this internally using PHP perhaps, then the rewrite
>> rules can be simple,a dnt eh CMS ensures the right url in all the
>> links.
>>     
>
> The CMS is written in PhP and I am trying to catch all instances of
> the old URL where I can and replacing with the new URL (the rules are
> also stored in a db for quick lookup).  So *internally* all the
> pidXX.html references should be taken care of.
>
>   
>> Where does the bookmark come from, chase down all the places where
>> they can see that link, and force it to be the new url, all seems a
>> bit backward. Next time tell your boss, "look you employed me to do
>> this job, so trust me to do it" sounds like a micro manager!
>>     
>
> Well - technically not a manager - a reseller I think.  Here's
> verbatim what they told me (old pages = pages/pidXX.html):
>
> "If we are changing url paths, we will need to setup 301's in
> their .htaccess files from the old pages to the 'new' pages. Thats
> the only way to insure the rankings wont drop.  ...  You want to
> avoid systems that create two separate instances of a page that have
> identical content but are addressable from different URLs. Duplicate
> content risks the appearance of "spamming" the search index."
>
> The big concern I think is Search Engines finding two URLs to the
> same page and somehow punishing the site because of it.  They might
> have pages/pid5.html as the products page and then crawl the site to
> find the link products.html is the same page.  
>
> I don't know enough about SEO to say much about this.
>   
yes you can make it as specific as you like
well the only way SE would find 2 urls is if the 2 urls are on your site
and being indexed by the bots, OR if your customers have links to the
old page on their sites.
If the latter is a problem fair enough, but if you have changed all the
internal links and this is the only place that links exist pointing to
the content then your version of the rewrite is all thats needed, no 301
etc... since nowhere relevant will the old link exist. SEO is a funny
game, arm waving and hunches, people will pay a lot for black box
services run by marketing gurus, eyes roll in the direction of M$

Here's how most of my rewrites are

    RewriteEngine On
    RewriteBase /
    RewriteRule ^$                        index.php/  [L]
    RewriteCond %{REQUEST_FILENAME}       !-f
    RewriteCond %{REQUEST_FILENAME}       !-d
    RewriteRule (.*)                      index.php/$1  [QSA,L]

then the application logic takes care of the URLs so no other rewrites
are ever needed, query strings become obselete as the URL maps to
variables; sometimes I might add regular expressions and conditions into
the above so that apache has first bite at the URL, and then php also
checks it over, no harm in that methinks.

good luck



-- 
Matthew Farey



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux