.htaccess help

Please report bugs here!

Moderator: Thorsten

Post Reply
mixian
Posts: 6
Joined: Wed Feb 03, 2010 1:46 am
Contact:

.htaccess help

Post by mixian »

hi all,i come from china.
i need your help about .htaccess.
i list my question as follow:
htaccess for subdirectories
i just install PHPMYFAQ in the subdirectory.and the root directory is Wordpress.
my host is Linux,apache.

a part of my .htaccess in phpmyfaq is

Code: Select all

RewriteEngine On
RewriteBase /faq/
# PMF faq record page
# * http://example.com/content_1_1_<LANGUAGE CODE>.htm
# * http://example.com/content_1_1_<LANGUAGE CODE>.html
RewriteRule content_([0-9]+)_([0-9]+)_([a-z\-]+)\.htm(l?)$ index.php?action=artikel&cat=$1&id=$2&artlang=$3 [L,QSA]
Now i can visit like this

Code: Select all

http://example.com/faq/content_1_1_zh.html
i think it works fine now,but i can't visit this URL from the page of my website.

I mean i visit the front page

Code: Select all

http://example.com/faq
,but the URL keep originals like this

Code: Select all

http://example.com/faq/content/1/1/zh/%E4%BB%80%E4%B9%88%E6%98%AF%E4%BF%A1%E7%94%A8%E8%AF%81%E5%91%A2%EF%BC%9F.html
i am very puzzled! please help me~~~
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: .htaccess help

Post by Thorsten »

Hi,

the URL http://example.com/faq/content_1_1_zh.html is the old rewrite from the 1.x versions, we now use the better one you mentioned below.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
mixian
Posts: 6
Joined: Wed Feb 03, 2010 1:46 am
Contact:

Re: .htaccess help

Post by mixian »

yes,i know it,but chinese will be changed like this

Code: Select all

http://example.com/faq/content/1/1/zh/%E4%BB%80%E4%B9%88%E6%98%AF%E4%BF%A1%E7%94%A8%E8%AF%81%E5%91%A2%EF%BC%9F.html
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: .htaccess help

Post by Thorsten »

Hi,

sure... it's URL encoded because of the chinese characters. Google and all browsers can handle it.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
mixian
Posts: 6
Joined: Wed Feb 03, 2010 1:46 am
Contact:

Re: .htaccess help

Post by mixian »

i just want to avoid this problem,so i am going to change the .htaccess.
of course.i can visit the url through new rules,but from the pages,the url is bad.

1.

Code: Select all

RewriteRule content_([0-9]+)_([0-9]+)_([a-z\-]+)\.htm(l?)$ index.php?action=artikel&cat=$1&id=$2&artlang=$3 [L,QSA]
i can visit the url like this:http://example.com/faq/content_1_1_zh.html
but from the pages,the urls keep originals as follow:
http://example.com/faq/content/1/1/zh/% ... BC%9F.html

2.

Code: Select all

RewriteRule content/([0-9]+)/([0-9]+)/([a-z\-]+)\.htm(l?)$ index.php?action=artikel&cat=$1&id=$2&artlang=$3 [L,QSA]
i can visit the url like this:http://example.com/faq/content/1/1/zh.html
but from the pages,the urls keep originals as follow:
http://example.com/faq/content/1/1/zh/% ... BC%9F.html

why???
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: .htaccess help

Post by Thorsten »

Hi,

because these URLs are generated by phpMyFAQ internally.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
mixian
Posts: 6
Joined: Wed Feb 03, 2010 1:46 am
Contact:

Re: .htaccess help

Post by mixian »

so you mean,the changes are no use.
although from the pages,the urls keep originals as follow:
http://example.com/faq/content/1/1/zh/% ... BC%9F.html
but when you visit it,just can get 404 error.

how can i get the new rules like 1.6 version??
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: .htaccess help

Post by Thorsten »

Hi,

you have to edit the file inc/Link.php.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
mixian
Posts: 6
Joined: Wed Feb 03, 2010 1:46 am
Contact:

Re: .htaccess help

Post by mixian »

hi,Thorsten,thank you for your quick reply.i will try,and any new situation,i will show here!!
mixian
Posts: 6
Joined: Wed Feb 03, 2010 1:46 am
Contact:

Re: .htaccess help

Post by mixian »

thank you again,i try again,and ok now~~
Post Reply