أضفت يتتبّع شقّ إلى النهاية من ال [أورل] مع [.هتكّسّ] صياغة جديدة قواعد
لموقعة أنّ يتلقّى [أورلس] أنّ ينهي مع شقّ (/), هو يكون ممارسة جيّدة أن يضمن أنّ كلّ [أورل] أنهى خطوات يكون يعرب ب ال [وب سرفر] مع يتتبّع شقّ, [إفن يف] زائرات ينسون أن يدخل النهاية شقّ. هذا يتفادى زائرات يكون يخدم مع 404 صفحة لا يؤسّس أو صفحة يستطيع لا يكون يعرض خطأ بما أنّ بعض نسيج نادلات يعاملون خطوات دون يتتبّع شقّ ك [فيل-نم] [إينستد وف] دليل, ولذلك يعجز أن يحدّد الوثائق. هو أيضا يزيل الإمكانية أنّ كلا صفحات مع نفسه محتوى, واحدة مع شقّ في النهاية وآخر بدون, يكون يشاهد ب [سرش نجن] كمحتوى مستنسخة.
كمثال, كلّ إصابات إلى http://www.mydigitallife.info/contact سوفت كنت يعيد إلى http://www.mydigitallife.info/contact/.
يساند كثير [وب سرفر], بما في ذلك الشعبيّة [أبش] [هتّبد] [وب سرفر] [مودروريت] وحدة نمطيّة حيث قواعد يستطيع كنت ثبتت في [.هتكّسّ] مبرد [إين وردر تو] أعدت أن يضيف يتتبّع شقّ إلى [أورلس] أنّ لا سابقا يتلقّى واحدة.
الرمز تالي يستطيع كنت وضعت في [.هتكّسّ] أن يعيد [أورل] دون يتتبّع شقّ إلى [أورل] مع يتتبّع شقّ:
[روريتينجن] فوق
[روريتبس]/
[روريتكند] % {[رقوستفيلنم]}! - [ف]
[روريتكند] % {[رقوستوري]}! [إيندإكس.فب]
[روريتكند] % {[رقوستوري]}! (. *)/$
[روريترول] ^ (. *) $ http://domain.com/$1/ [[ل], [ر301]]
أو
[روريتكند] % {[رقوستفيلنم]}! - [ف]
[روريتكند] % {[رقوستوري]}! \. +$
[روريتكند] % {[رقوستوري]}! /$
[روريترول] (. *) http://www.mydigitallife.info/$1/ [[ر301], [ل]]
أو
[روريتينجن] فوق
[روريتبس]/
[روريترول] ^ ([[أ-ز-ز0-9]]+)/$/$1 [[ل]]
[روريتكند] % {[ثرقوست]} ^ [[أ-ز]] {3,9} \/([[أ-ز-ز0-9]]+)
[روريترول] ^ ([[أ-ز-ز0-9]]+) $/%1/? [[ر301], [ل]]
يستعمل في أنت [كم] أو [بلوغ] مثل [ووردبرسّ] أنّ يسمح حسب الطّلب [أورل] بنية ل [برملينكس], خصوصا ل [سرش نجن] تحسين ([سو]), الرمز آنفة سوفت أتيت قبل القالب من صياغة جديدة شروط وقواعد ل [أورل] تصنيع حسب الطّلب ل ال [كم] أو [بلوغ] منصة.
[إإكسبلينأيشن] موجزة من الصياغة جديدة رمز أن يضيف يتتبّع شقّ إلى [أورل]
[روريتينجن] فوق - [لين نبل] هذا ال [رونتيم] يعيد محرك يؤسّس على [مودروريت] وحدة نمطيّة [أبش].
[روريتبس]/- يثبت هذا خطّ ال [كرّنت بج] [رووت ديركتوري] كقاعدة [أورل] ل [بر-ديركتوري] [روريتس].
[روريتكند] % {[رقوستفيلنم]}! - [ف] - يستثني هذا خطّ كلّ [أورلس] يدلّ إلى يتواجد مبارد من يكون يضاف مع يتتبّع شقّ ثانية. أدلة يستطيع لا يكون استثنيت بما أنّ هذا استثنى الصياغة جديدة تصرف لأدلة موجودة.
[روريتكند] % {[رقوستوري]}! [إيندإكس.فب] - هذا خطّ اختياريّة, ويستثني إرادة عينة [أورل] ([إين ثيس كس], [إيندإكس.فب]) أنّ مستعملات لا يريد هو أن يكون أعدت. أزلت هذا خطّ [إيف نوت] ضروريّة.
[روريتكند] % {[رقوستوري]}! \. عيّنت +$ - أنّ ال [أورل] لا يحتوي أيّ. (نقطة) أن يستثني مرجع إلى مبرد.
[روريتكند] % {[رقوستوري]}! (. *)/$ - يحدّ هذا خطّ الذي [أورل] لا يحتوي يتتبّع شقّ
RewriteRule ^(.*)$ http://www.domain.com/$1/ [L,R=301] - This line process URL without trailing slash that has passed conditions set above, by appending a trailing slash and then redirect with 301 or permanent redirect status to the new URL. L mean this is the last line to process and the rewrite process can be terminated. Remember to replace the www.domain.com with your own domain name.
Brief explaination for second set of rewrite rules and rule conditions
RewriteRule ^([a-zA-Z0-9]+)/$ /$1 [L] - This line terminates the trailing slash appending rewrite process if the URL already contains trailing slash.
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([a-zA-Z0-9]+) - This line determines request that does not ends with trailing slash.
RewriteRule ^([a-zA-Z0-9]+)$ /%1/? [R=301,L] - This line append a slash to the end of URI and perform a 301 permanent redirect to the new URL with trailing slash, and terminate the rewrite block.
IMPORTANT: This is a machine translated page which is provided "as is" without warranty. Machine translation may be difficult to understand. Please refer to original English article whenever possible.
Share and contribute or get technical support and help at My Digital Life Forums.
Related Articles
- Redirect or Rewrite to Remove Double or Multiple Slashes (//) in URL
- SEO Friendly Rewrite Method to Move Website URL From Subdirectory to Root Parent Folder
- Remove and Uninstall or Disable ModSecurity (mod_security)
- WordPress Permalinks Does Not Work in xampp Setup
- Remove or Trim First or Last Few Characters in MySQL Database with SQL
- How to Move WordPress Blog to New Domain or Location
- Fix Session Save Path Red Unwritable When Installing Joomla!
- How to Add a MySpace User As Friend in Friends List
- How to Activate and Use FeedBurner MyBrand for Free
- How to Add and Put Picture or Image in MySpace Comment


























July 26th, 2008 05:19
[...] ÄÃm predÃdete aj problému Ä.2. Pre htaccess som naÅ¡iel pekný, ale anglický Älánok o tom, how to add trailing slash to the end of the URL. Možnosti máte [...]