[pLog-svn] Htaccess update

Oscar Renalias oscar at renalias.net
Thu Mar 1 03:06:40 EST 2007


I'm not sure if we ever documented it, but you can rename the files  
"post", "archive", "blog" and so on that can be found in the root  
folder of LT to whatever you want and then adjust your custom URLs  
without subdomains to use the new names. The URL parsing engine will  
happily work with whatever you throw at it, and Apache won't log 404  
errors because it'll be using those files as the access points (and  
they exist in disk)

So if language was a problem for me, I could rename the file called  
"post" to "articulo", the file called "archive" to "archivos" and  
then adjust post_permalink and archive_link to use these two instead  
of the original ones. Then you don't need mod_rewrite and you won't  
get 404 errors either.

But whatever rocks your boat... If your approach works better for you  
and you find it cleaner than our implementation, so be it.

On 1 Mar 2007, at 09:54, Ayalon wrote:

> Hi All, Hi Oscar,
>
> Fully understand what you and Oscar say. But in my language those  
> name are
> not suitable for me, so I changed the url's to more local names.  
> This will
> cause the software to use the error.php file for finding those  
> url's. This
> will ofcourse generate an error.log, but will return the url  
> correctly, as
> the error.php will handle them. In the Netherlands we have loads of  
> lifetype
> users doing it like this.
>
> What I'm saying is this:
> http://wiki.lifetype.net/index.php/Custom_URLs#Why_removing_.2Fblog. 
> 2F_from_
> the_URLs_is_evil
>
> If you take my solution it's not evil anymore, and will never  
> generate an
> error in the apache logs and will always get the correct url. This  
> means the
> logs will be "clear" and you can run good statistics over your  
> logfiles.
>
> Guys, there out there a lot of users using these kind of url's. I  
> can give
> you a lot of samples from my local country, this is a really simple  
> but
> effective solution for having this kind (or all kinds) of url's  
> without
> having to deal with all kind of issues that can happen in the  
> htaccess file,
> you simply need 3 lines of code in there. Lifetype could even have  
> there own
> 404 page as you don't need the error.php in the errordocument  
> directive etc.
> Subdomains with custom url's are populair, don't forget that.
>
> This solution I found from my work CMS which has this in the  
> htaccess file
> to return permalinks on apache. When searching the net I found out  
> that
> similar software is also using this kind of solutions. If I search the
> forums for htaccess I get around 2% of all the questions having  
> htaccess
> file in there, not all will be about this issue but anyway some  
> will be.
> Simple hosts will almost always allow this directive and will not  
> all allow
> custom 404 pages etc, or other directives.
>
> My 2 cents,
> Ayalon
>
> -----Oorspronkelijk bericht-----
> Van: plog-svn-bounces at devel.lifetype.net
> [mailto:plog-svn-bounces at devel.lifetype.net] Namens Oscar Renalias
> Verzonden: woensdag 28 februari 2007 23:37
> Aan: plog-svn at devel.lifetype.net
> Onderwerp: Re: [pLog-svn] Htaccess update
>
> If you were getting errors, check your Apache error logs and have a
> look at the URLs that were causing those 40x errors. In lifetype.net
> I noticed that repeated requests for favicon.ico were causing those
> errors, you may be having the same problem. And with regards to using
> subdomains and eliminating /blog/ or /blog.php/ from the URL, as Jon
> said it won't cause any problem as long as you keep /post/, /
> archives/, /resource/, etc.
>
> On 1 Mar 2007, at 00:05, Jon Daley wrote:
>
>>  	Please give an example when error.php would be used?  It isn't
>> used on any blog that I know about.  There is only one blog that I
>> used aa
>> similar sort of rule to yours, although LT wasn't the only thing on
>> that
>> site, so my rule was more complicated.  But, for "normal"
>> installations,
>> those rules aren't needed - nor is error.php.  That is only for
>> errors.
>>
>> On Wed, 28 Feb 2007, Ayalon wrote:
>>> SO you think for performance reasons it's better to let it be
>>> handled with
>>> the error.php instead of a rewrite rule?
>>>
>>> -----Oorspronkelijk bericht-----
>>> Van: plog-svn-bounces at devel.lifetype.net
>>> [mailto:plog-svn-bounces at devel.lifetype.net] Namens Jon Daley
>>> Verzonden: woensdag 28 februari 2007 21:52
>>> Aan: plog-svn at devel.lifetype.net
>>> Onderwerp: Re: [pLog-svn] Htaccess update
>>>
>>> 	The only reason one would need the sort of thing you are talking
>>> about is to have urls that don't have /post, /archive, /category,
>>> etc in
>>> them.  For example, http://jon.limedaley.com uses the default
>>> rules.  And
>>> the /plog is there because lifetype is installed in the /plog
>>> directory,
>>> as opposed to the rest of my site.
>>> 	You don't need /blog.php or /blog in your URLs, with or without
>>> your htaccess rules.
>>> 	The current "complicated" htaccess rules are only for modrewrite
>>> URLs.  I guess you could get rid of the ForceType/SetHandler lines
>>> at the
>>> expense of using your rewrite rule for every access.  How much
>>> time do
>>> your two rewrite rules take?  I assume it is a small, and fairly
>>> unnoticeable delay, but it does add a check to see if the file
>>> exists for
>>> every HTTP request, and so at least for large sites, might not be
>>> ideal.
>>>
>>>
>>> On Wed, 28 Feb 2007, ayalon at blog.nl wrote:
>>>> Well it's search engine friendly, but there are called custom
>>>> url's that's
>>>> right.
>>>>
>>>> Anyway lifetype will need the error php in the errorducoment for
>>>> this to
>>> work
>>>> correctly if you don't want /blog.php or /blog in your url. And
>>>> this will
>>>> create error logs (look at the wiki pages).
>>>>
>>>> With my solution this is not happening anymore. And as far as i
>>>> can see
>>>> a lot of
>>>> lifetype admins are using this.
>>>>
>>>> Citeren Oscar Renalias <oscar at renalias.net>:
>>>>
>>>>> If you were getting errors in your log files it's beacause you had
>>>>> something wrong in the first place. When using subdomains or  
>>>>> custom
>>>>> URLs, you should not be getting any 40x errors at all and if you
>>>>> did,
>>>>> you should have removed the ErrorDocument parameters from
>>>>> your .htaccess and then see what was failing. Otherwise
>>>>> error.php is
>>>>> only needed for the so-called "search engine friendly" URLs.
>>>>>
>>>>> On 28 Feb 2007, at 17:43, Ayalon wrote:
>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> As also posted on the forums:
>>>>>> http://forums.lifetype.net/viewtopic.php?p=33349
>>>>>>
>>>>>> To keep errors out of the logfiles and to handle all the  
>>>>>> requested
>>>>>> by the
>>>>>> server not by having errors in the logfiles when using
>>>>>> subdomains and
>>>>>> friendly url's
>>>>>>
>>>>>> The only thing I have in my .htaccess is the following:
>>>>>>
>>>>>> RewriteEngine On
>>>>>> RewriteBase /
>>>>>>
>>>>>> RewriteCond %{REQUEST_FILENAME} !-f
>>>>>> RewriteCond %{REQUEST_FILENAME} !-d
>>>>>> RewriteRule . /blog.php
>>>>>>
>>>>>> This will do the job for almost everything, except the pager.  
>>>>>> This
>>>>>> is not
>>>>>> working via this solution, probably because it's not handled the
>>>>>> same way as
>>>>>> the posts and the categories are.
>>>>>>
>>>>>> Anybody has an idea on this? If this works fine, we don't even
>>>>>> need
>>>>>> the huge
>>>>>> htaccess file anymore within lifetype and it will handle
>>>>>> everything
>>>>>> a lot
>>>>>> faster inside the environment as it doesn't have to pass the
>>>>>> error.php
>>>>>> before finding the good file.
>>>>>>
>>>>>> What do you guys think?
>>>>>>
>>>>>> Regards,
>>>>>> Ayalon
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> pLog-svn mailing list
>>>>>> pLog-svn at devel.lifetype.net
>>>>>> http://limedaley.com/mailman/listinfo/plog-svn
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> pLog-svn mailing list
>>>>> pLog-svn at devel.lifetype.net
>>>>> http://limedaley.com/mailman/listinfo/plog-svn
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> pLog-svn mailing list
>>>> pLog-svn at devel.lifetype.net
>>>> http://limedaley.com/mailman/listinfo/plog-svn
>>>>
>>>
>>> -- 
>>> Jon Daley
>>> http://jon.limedaley.com/
>>>
>>> If you think good architecture is expensive, try bad architecture
>>> -- Brian Foote and Joseph Yoder
>>> _______________________________________________
>>> pLog-svn mailing list
>>> pLog-svn at devel.lifetype.net
>>> http://limedaley.com/mailman/listinfo/plog-svn
>>>
>>>
>>> _______________________________________________
>>> pLog-svn mailing list
>>> pLog-svn at devel.lifetype.net
>>> http://limedaley.com/mailman/listinfo/plog-svn
>>>
>>
>> -- 
>> Jon Daley
>> http://jon.limedaley.com/
>>
>> Keep a stiff upper chin.
>> -- Sam Goldwyn, Hollywood producer
>> _______________________________________________
>> pLog-svn mailing list
>> pLog-svn at devel.lifetype.net
>> http://limedaley.com/mailman/listinfo/plog-svn
>>
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
>
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
>



More information about the pLog-svn mailing list