我想要丢失文件和无效目录的请求重定向到自定义404错误页面.我相信这可以用2种方法完成.
# redirect invalid requests and missing files to the not-found page
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://www.example.com/not-found.html [L]
# same idea but using error document
ErrorDocument 404 /not-found.html
Run Code Online (Sandbox Code Playgroud)
一种选择比另一种更好吗?我什么时候想要使用另一个?
大家好,我想以下面的格式创建我的分页
转到第3页[文本框]上一页1 2 3 4 5 .... 400下一页
以下是我的代码
if(isset($_REQUEST['limit_start']) && $_REQUEST['limit_start'] > 0) $limit_start = $_REQUEST['limit_start'];
else $limit_start = 0 ;
if(isset($_REQUEST['results_to_show']) ) $results_to_show= $_REQUEST['results_to_show'];
else $results_to_show = 100;
if(($limit_start-$results_to_show)>=0)
$pagination.='<a href="details-inventory.php?limit_start='.($limit_start-$results_to_show).'&&results_to_show='.$results_to_show.'" >Previous</a> | ';
if (isset($_REQUEST['submit']) && $_REQUEST['submit'] != "")$search_limited = 1;
else $search_limited = 0;
global $wpdb;
$sql='SELECT count(*)
FROM `inventory_location` ';
$data= $wpdb->get_results($sql,ARRAY_A);
$row_count= $data[0]['count(*)'];
for($number=(($limit_start/$results_to_show)+1);$number<($row_count/$results_to_show);$number++)//($row_count/$results_to_show);$number++)($limit_start/$results_to_show)+
$pagination.= '<a href="details-inventory.php?limit_start='.($number*$results_to_show).'&&results_to_show='.$results_to_show.'" >'.$number.'</a> | ';
$pagination.= ' <a href="details-inventory.php?limit_start='.($limit_start+$results_to_show).'&&results_to_show='.$results_to_show.'" >Next </a> <br />';
Run Code Online (Sandbox Code Playgroud)
现在问题是这.....它显示从1到最后一页的所有数字...我想在下面的风格打破它
1 2 3 4 5 …Run Code Online (Sandbox Code Playgroud) 我尝试设置Symfony2插件,以便我可以使用注释.我安装了插件,PHPStorm重新启动,缓存失效.
现在,一些代码:
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
Run Code Online (Sandbox Code Playgroud)
当我放@ORM\,我击中Ctrl+ Space我看到No suggesions.
这不起作用?我设错了什么?
.htaccess ×1
annotations ×1
pagination ×1
php ×1
phpstorm ×1
redirect ×1
seo ×1
symfony ×1
wordpress ×1