Замена вида ссылки через htaccess

Тема в разделе "Joomla и SEF (ЧПУ)", создана пользователем Flizinforg, 22.06.2010.

  1. Offline

    Flizinforg Недавно здесь

    Регистрация:
    22.06.2010
    Сообщения:
    3
    Симпатии:
    0
    Пол:
    Мужской
    Читал по форуму, нашел решение, но оно у меня не работает.

    Есть ссылка вида http://www.site.ru/n93-47.html
    (Ее вид, если вывести адрес страницы с помощью php - http://www.site.ru/index.php?option=com_content&task=view&Itemid=93&id=47)

    Нужно переделать только ее в вид http://www.site.ru/super_puper/

    Делал вот так:

    Код (CODE):
    1. RewriteRule ^(super_puper) index.php?option=com_content&task=view&Itemid=93&id=47

    и вот так:
    Код (CODE):
    1. RewriteRule ^(super_puper) n93-47.html


    Перед строкой
    Код (CODE):
    1. RewriteCond %{REQUEST_FILENAME} !-f
    в .htaccess


    Мой .htaccess

    Код (CODE):
    1. ##
    2. # @version $Id: htaccess.txt 5973 2006-12-11 01:26:33Z robs $
    3. # @package Joomla
    4. # @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
    5. # @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
    6. # Joomla! is Free Software
    7. ##
    8. #####################################################
    9. #  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
    10. #
    11. # The line just below this section: 'Options +FollowSymLinks' may cause problems
    12. # with some server configurations.  It is required for use of mod_rewrite, but may already
    13. # be set by your server administrator in a way that dissallows changing it in
    14. # your .htaccess file.  If using it causes your server to error out, comment it out (add # to
    15. # beginning of line), reload your site in your browser and test your sef url's.  If they work,
    16. # it has been set by your server administrator and you do not need it set here.
    17. #
    18. # Only use one of the two SEF sections that follow.  Lines that can be uncommented
    19. # (and thus used) have only one #.  Lines with two #'s should not be uncommented
    20. # In the section that you don't use, all lines should start with #
    21. #
    22. # For Standard SEF, use the standard SEF section.  You can comment out
    23. # all of the RewriteCond lines and reduce your server's load if you
    24. # don't have directories in your root named 'component' or 'content'
    25. #
    26. # If you are using a 3rd Party SEF or the Core SEF solution
    27. # uncomment all of the lines in the '3rd Party or Core SEF' section
    28. #
    29. #####################################################
    30. #####  SOLVING PROBLEMS WITH COMPONENT URL's that don't work #####
    31. # SPECIAL NOTE FOR SMF USERS WHEN SMF IS INTEGRATED AND BRIDGED
    32. # OR ANY SITUATION WHERE A COMPONENT's URL's AREN't WORKING
    33. #
    34. # In both the 'Standard SEF', and '3rd Party or Core SEF' sections the line:
    35. # RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
    36. # May need to be uncommented.  If you are running your Joomla!/Mambo from
    37. # a subdirectory the name of the subdirectory will need to be inserted into this
    38. # line.  For example, if your Joomla!/Mambo is in a subdirectory called '/test/',
    39. # change this:
    40. # RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
    41. # to this:
    42. # RewriteCond %{REQUEST_URI} ^(/test/component/option,com) [NC,OR] ##optional - see notes##
    43. #
    44. #####################################################
    45. ##  Can be commented out if causes errors, see notes above.
    46. Options +FollowSymLinks
    47. #
    48. #  mod_rewrite in use
    49. RewriteEngine On
    50. #  Uncomment following line if your webserver's URL
    51. #  is not directly related to physical file paths.
    52. #  Update Your Joomla!/MamboDirectory (just / for root)
    53. # RewriteBase /
    54. ########## Begin - Joomla! core SEF Section
    55. ############# Use this section if using ONLY Joomla! core SEF
    56. ## ALL (RewriteCond) lines in this section are only required if you actually
    57. ## have directories named 'content' or 'component' on your server
    58. ## If you do not have directories with these names, comment them out.
    59. #
    60. #RewriteCond %{REQUEST_FILENAME} !-f
    61. #RewriteCond %{REQUEST_FILENAME} !-d
    62. #RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR]        ##optional - see notes##
    63. #RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
    64. #RewriteRule ^(content/|component/) index.php
    65. #
    66.  
    67. ########## End - Joomla! core SEF Section
    68. RewriteCond %{REQUEST_FILENAME} !-f
    69. RewriteCond %{REQUEST_FILENAME} !-d
    70. RewriteRule ^(.*)$ index.php
    71. php_value register_globals off
    72. ########## Begin - 3rd Party SEF Section
    73. ############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
    74. #
    75. #RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR]        ##optional - see notes##
    76. #RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
    77. #RewriteCond %{REQUEST_FILENAME} !-f
    78. #RewriteCond %{REQUEST_FILENAME} !-d
    79. #RewriteRule (.*) index.php
    80. #
    81. ########## End - 3rd Party SEF Section
    82. ########## Begin - Rewrite rules to block out some common exploits
    83. ## If you experience problems on your site block out the operations listed below
    84. ## This attempts to block the most common type of exploit `attempts` to Joomla!
    85. #
    86. # Block out any script trying to set a mosConfig value through the URL
    87. RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
    88. # Block out any script trying to base64_encode crap to send via URL
    89. RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
    90. # Block out any script that includes a <script> tag in URL
    91. RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
    92. # Block out any script trying to set a PHP GLOBALS variable via URL
    93. RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
    94. # Block out any script trying to modify a _REQUEST variable via URL
    95. RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
    96. # Send all blocked request to homepage with 403 Forbidden error!
    97. RewriteRule ^(.*)$ index.php [F,L]
    98. #
    99.  
    100. php_value error_reporting 1


    Помогите, пожалуйста, разобраться.
     
  2.  
  3. Fanamura
    Offline

    Fanamura Доброта

    Регистрация:
    12.03.2007
    Сообщения:
    5 094
    Симпатии:
    158
    Пол:
    Мужской
    Flizinforg, а чем SEF-компоненты не угодили?
     
  4. Offline

    Flizinforg Недавно здесь

    Регистрация:
    22.06.2010
    Сообщения:
    3
    Симпатии:
    0
    Пол:
    Мужской
    Да нужно изменить одну ссылку и всё. Сайт не мой и некогда заморачиваться и разбираться. Страшно, что после установке компонентов SEF что-нибудь другое навернется.
     
  5. Offline

    Flizinforg Недавно здесь

    Регистрация:
    22.06.2010
    Сообщения:
    3
    Симпатии:
    0
    Пол:
    Мужской
    Неужели нет еще решений? Очень нужна помощь.
     

Поделиться этой страницей

Загрузка...