我正在为我的WordPress网站开发测验部分。 我的网站上安装了W3总caching。 我想要提问
http://www.example.com/quiz/SEO-friendly-title/id
并重写htaccessredirect的url
http://www.example.com/quiz?title=SEO-friendly-title&quiz-id=id
.htaccess重写:子域名作为GET参数和文件path完好无损后
.htaccess将域名redirect到子目录而不更改URL
在Apache中使用.htpasswd时,使子文件夹不受限制
为什么这个RewriteRule和一起工作,而不和一起工作?
从url中删除'index.html',并用一个301redirect添加'www'
测验部分是作为wordpress模板开发的,使用这个模板制作了一个空白页面。
这是我写的.htaccess。
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^quiz/([wd-]+)/(d]+)$ quiz?title=$1&quiz-id=$2 [L] RewriteRule ^index.PHP$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.PHP [L] </IfModule>
任何forms的帮助将不胜感激!
.htaccess不工作在我的Ubuntu 14.04发行版
问题与MIMEtypes和服务svg:资源解释为图像,但与MIMEtypes的文本/ XML传输
在Apache中使用htaccess重写HTTP GET请求到POST
.htaccess将所有的扩展名redirect到PHP
你可以试试这个:
<Ifmodulee mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^quiz/SEO-friendly-title/(.*)$ quiz?title=SEO-friendly-title&quiz-id=$1 [R,L] RewriteRule ^index.PHP$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.PHP [L] </Ifmodulee>
你有没有去设置和永久链接? 如果是的话,它不是你想要的在这里看看
add_action('init','a_add_rewrite_rule'); function a_add_rewrite_rule(){ // add_rewrite_rule(REGEX url,location,priority (ie top is before other rewrite rules) // I created a custom post type for this plugin called market -- replace post_type with whatever you want //basically tell wordress to add a query var if sidebar is added to url. add_rewrite_rule('^sidebar?','index.PHP?is_sidebar_page=1&post_type=market','top'); } // register a query var add_action('query_vars','market_set_query_var'); function market_set_query_var($vars) { array_push($vars,'is_sidebar_page'); return $vars; } // associate a template with your quer_var add_filter('template_include','market_include_template',1000,1); function market_include_template($template){ if(get_query_var('is_sidebar_page')){ $new_template = (theme or plugin path).'/pages/yourpage.PHP'; // change this path to your file if(file_exists($new_template)) $template = $new_template; } return $template; }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。