2013-02-12 39 views
-1

的mod_rewrite我找不到在笨维基mod_rewrite的了吗?它去了哪里?我试图寻找这个link,但它不是在这里了。找不到笨

+0

您所选择的互联网搜索引擎通常能帮助你搜索。只是注意你是否需要提示如何继续。 – hakre 2013-02-12 09:36:37

+0

如此多的代码维基链接现在被破坏:( – 2013-02-12 12:29:10

回答

1

mod_rewrite的是Apache Web服务器的一部分,它不是笨的一部分,该扩展使用写SEO友好的URL

有这个环节,这将有助于你写的搜索引擎友好的URL上看

SEO friendly urls

检查的mod_rewrite加载与否只是把空的PHP文件phpinfo()函数调用浏览器,文件,然后搜索mod_rewrite的启用它搜索您的Apache Web服务器的conf目录下的Apache的httpd.conf,如果它与#评论只需将其删除并在加载后重新启动Web服务器即可服务器调用再次phpinofo和搜索mod_rewrite的

1

.htaccess应该是这个样子:

<IfModule mod_rewrite.c> 
RewriteEngine On 
#Removes access to the system folder by users. 
#Additionally this will allow you to create a System.php controller, 
#previously this would not have been possible. 
#'system' can be replaced if you have renamed your system folder. 
RewriteCond %{REQUEST_URI} ^system.* 
RewriteRule ^(.*)$ index.php?/$1 [L] 

#When your application folder isn't in the system folder 
#This snippet prevents user access to the application folder 
#Submitted by: Fabdrol 
#Rename 'application' to your applications folder name. 
RewriteCond %{REQUEST_URI} ^application.* 
RewriteRule ^(.*)$ index.php?/$1 [L] 

#Checks to see if the user is attempting to access a valid file, 
#such as an image or css document, if this isn't true it sends the 
#request to index.php 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?$1 [L] 
</IfModule> 
<IfModule !mod_rewrite.c> 
ErrorDocument 404 index.php 
</IfModule>