|
|
|
| Написал в .htaccess
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ newindex.php [R=permanent]
|
Однако, код не хочет перенаправлять запросы от index.php к newindex.php... | |
|
|
|
|
|
|
|
для: Sturmvogel
(03.10.2010 в 15:35)
| | никаких ошибок, просто не работает ?
попробуйте добавить в начало
Options +FollowSymLinks | |
|
|
|
|
|
|
|
для: heed
(04.10.2010 в 01:49)
| | тоже не помогло... логи пустые... | |
|
|
|
|
|
|
|
для: Sturmvogel
(04.10.2010 в 02:46)
| | в адресной строке запрашивается именно /index.php , или просто / ?
если первое, то похоже нужно разбираться в httpd.conf с диррективой AllowOverride для дирректории в которую вложен сайт.
если второе, то так и должно быть. | |
|
|
|
|
|
|
|
для: heed
(04.10.2010 в 15:52)
| | да, запрашивался именно index.php... а как тогда должна быть выставлена AllowOverride? | |
|
|
|
|
|
|
|
для: Sturmvogel
(04.10.2010 в 22:22)
| | AllowOverride Directive
Description: Types of directives that are allowed in .htaccess files
Syntax: AllowOverride All|None|directive-type [directive-type] ...
Default: AllowOverride All
Context: directory
Status: Core
Module: core
|
When the server finds an .htaccess file (as specified by AccessFileName) it needs to know which directives declared in that file can override earlier configuration directives.
Only available in <Directory> sections
AllowOverride is valid only in <Directory> sections specified without regular expressions, not in <Location>, <DirectoryMatch> or <Files> sections.
|
...
там далее возможные директивы для
...
и потом такое:
Options[=Option,...]
Allow use of the directives controlling specific directory features (Options and XBitHack). An equal sign may be given followed by a comma (but no spaces) separated lists of options that may be set using the Options command.
Можно конечно не заморачиваться читая после такого описание диррективы Options , а просто поставить AllowOverride All
Но раз-уж доступна правка httpd.conf можно и просто добавить FollowSymLinks к опциям действующим в нужных местах в результате применений дирректив Options
// но лучше всё-таки читать если есть желание изменять Options
зато можно и не читать по mod_rewrite , там только пару строк:
The rewrite engine may be used in .htaccess files. To enable the rewrite engine for these files you need to set "RewriteEngine On" and "Options FollowSymLinks" must be enabled. If your administrator has disabled override of FollowSymLinks for a user's directory, then you cannot use the rewrite engine. This restriction is required for security reasons. | |
|
|
|
|
|
|
|
для: heed
(04.10.2010 в 23:25)
| | чисто виртуальный хост определен, кстати, как
<VirtualHost *:80>
DocumentRoot /var/www/html/trololo/htdocs/
ServerName trololo
ServerAlias www.trololo
<Directory "/var/www/trololo/htdocs/">
AllowOverride All
Allow from All
Options All
</Directory>
</VirtualHost>
|
Плюс еще ко всему стоит апач на Линуксе... | |
|
|
|
|
|
|
|
для: Sturmvogel
(09.10.2010 в 19:02)
| | почему разные пути DocumentRoot и Directory ?
DocumentRoot /var/www/html/trololo/htdocs/
......
<Directory "/var/www/trololo/htdocs/">
......
</Directory>
или так и задуманно ? | |
|
|
|
|
|
|
|
для: heed
(09.10.2010 в 19:28)
| | это я ошибся, исправляя путь, стер html...
в общем, еще чутка помухлевал и все заработало! спасибо за помощь ;) | |
|
|
|