简体   繁体   English

modRewrite问题和modRewrite规则

[英]modRewrite issues, and modRewrite rules

Haay! Haay!

Have a question about ModRewrite for apace webserver. 有一个关于ModRewrite for apace网络服务器的问题。 recently i have fixed one of my urls: 最近我已经修复了我的网址之一:

Before : http://pagename.com/index.php?sideID=home 之前http : //pagename.com/index.php?sideID=home

RewriteEngine on
RewriteRule ^([a-zA-Z0-9]+)$ index.php?sideID=$1

After : http://pagename.com/home 之后http : //pagename.com/home

Now I have a more advanced problem when I want to pass more variables trough URL to create my blogg. 现在,当我想通过URL传递更多变量来创建博客时,我遇到了一个更高级的问题。

currently : http://pagename.com/index.php?sideID=blogg&id=12&title=a-great-blog-post 当前http : //pagename.com/index.php?sideID=blogg&id=12&title=a-great-blog-post

I would like this to be more clean and structured, I want somthing like: 我希望它更加干净和结构化,我想要一些东西:

http://pagename.com/blogg/12/Gratulerer-FEEL-GOOD-med-ny-hjemmeside http://pagename.com/blogg/12/Gratulerer-FEEL-GOOD-med-ny-hjemmeside

I have tested something like this: 我已经测试过这样的东西:

RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ index.php?sideID=$1&id=$2&title=$3

without any success, any anwser leading to my success will be highly aprecciated :) 没有任何成功,任何导致我成功的烦恼都会被高度感激:)

Here is my current .htaccess file: 这是我当前的.htaccess文件:

RewriteEngine on
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?sideID=$1
RewriteRule ^bloggg/([^/]+)/([^/]+)/([^/]+)/?$ index.php?sideID=$1&id=$2&title=$3 [L,QSA]

使用以下附加规则:

RewriteRule ^blogg/([^/]+)/([^/]+)/([^/]+)/?$ index.php?sideID=$1&id=$2&title=$3 [L,QSA]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM