0
我想重写一些使用mod_rewrite的网址。.htaccess重写规则问题
我想重写
localhost/exotica/pet/somePet/
到
`localhost/exotica/index.php/types/get/somePet/`
我设法用
RewriteCond $1 !^(index\.php|resources|uploads|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /exotica/index.php/$1 [L]
所以现在localhost/exotica/types/get/somePet
作品 删除的index.php我已经尝试添加作为第一条规则
RewriteRule ^pet/([A-Za-z0-9-]+)/?$ type/get/$1 [N]
,但它只是不工作,所以请帮助我,我不知道如何启用它
我设法通过添加路由$route['pet/(:any)'] = "type/get/$1";
来解决它,但我宁愿它使用.htacess文件
从'/异国情调/宠物/ somePet /'(进入SEO格式)'/珍品/ index.php文件/类型/ GET/somePet /'去是无稽之谈。充其量,你仍然必须重写成“动态”格式,比如'/exotica/index.php?types = xxxxx&op = get&name = somePet',你也可以这样做。 –
所以问题解决了? – anubhava
@anubhava没问题aint解决因为我想用mod重写而不是codeigniter rutes。 –