与.htacces友好的URL不工作...和计算器的URL风格 [英] Friendly URLs with .htacces NOT working... and stackoverflow URLs style

查看:126
本文介绍了与.htacces友好的URL不工作...和计算器的URL风格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已经被问的次数在这里计算器一百万,但我不能让它的工作,所以我需要有人谁知道最终解决这个问题!

I know this question has been asked a million of times here at stackoverflow, but I cant get it to work so I need someone who knows to finally resolve this problem!

欲,当这个被插入的网址:

I want that when this is inserted in the URL:

http://website.com/pelicula/0221889/
http://website.com/pelicula/0221889/posters/

这真的去这样的:

It really goes to this:

http://website.com/index.php?ctrl=pelicula&id=0160399
http://website.com/index.php?ctrl=pelicula&id=0160399&tab=posters

这是我的.htacces文件看起来像:

This is how my .htacces file looks like:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^/([^/]+)/([^/]+)/?([^/]*)/?$ index.php?ctrl=$1&id=$2&tab=$3 [QSA,L]
</IfModule>

但它不工作!我只是得到一个未找到的错误在我的Web服务器(只有使用友好的URL时,经常还在工作的罚款)。如何解决这一问题?

But its not working! I just get a 'Not found' error in my web server (only when using the friendly URL, regular is still working fine). How to fix this?

我也想知道如何才能够在URL的结尾没有得到任何错误(如计算器的URL)添加任何东西。

I would also want to know how to be able to add anything at the end of the URL without getting any errors (like stackoverflow URLs).

这样的:

http://website.com/pelicula/0221889/any-text-i-want-to-put
http://stackoverflow.com/questions/3033407/htacces-to-create-friendly-urls-help-needed

我希望有人可以给我一个答复,谢谢!

I hope someone can give me an answer, thanks!

推荐答案

我读了所有的线程,所以我不打算重申别人怎么说或要求。我只是抛出的想法在这里,但...

I read all of your threads so I'm not going to reiterate what others have said or asked. I'm just throwing out ideas here but...

听起来重写是工作 - 它实际上是重定向正确的 - 但它指向你是找不到的页面。您是否尝试过使用的RewriteBase?

Sounds like rewrite is working - it's actually redirecting correctly - but it's pointing you to a page that is not found. Have you tried using RewriteBase?

RewriteEngine On
RewriteBase /

这篇关于与.htacces友好的URL不工作...和计算器的URL风格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆