Forum Moderators: phranque

Message Too Old, No Replies

.htaccess help

         

mixian

12:43 am on Feb 2, 2010 (gmt 0)

10+ Year Member



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
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
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
http://example.com/faq
,but the URL keep originals like this
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~~~

[edited by: jdMorgan at 2:12 pm (utc) on Feb. 2, 2010]
[edit reason] Please use example.com. [/edit]

jdMorgan

2:19 pm on Feb 2, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not sure I fully understand the problem, but in addition to rewriting the new "friendly" URLs to the original script path, you will need to change the links on your pages to the new 'search-engine-friendly' URL format.

There are three steps to implementing 'friendly' URLs:

1) Add an internal rewrite (as you have done) to pass requests for friendly URLs to the original script.
2) Modify the pages or the script which generates those pages to output 'friendly' URLs in the links on those pages.
3) Add an external redirect to redirect only direct client requests for the old 'unfriendly' URLs back to the new 'friendly' URLs. This last step is optional, and is not always possible if the unfriendly URLs do not contain all of the information needed to determine the new friendly URLs.

Jim