Plz help me config .htaccess file

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
User avatar
angelpeace
Forum Members
Forum Members
Posts: 39
Joined: Fri May 15, 2009 9:45 am

Plz help me config .htaccess file

Post by angelpeace »

My Website used CMS Package
My .htaccess file:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_METHOD} !POST$
RewriteRule ^(.*) %{REQUEST_URI}/ [NE,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

Result OK

"http://www.mydomain.com/search/?key_word=cp10

=> OK

I want to Replace:

?key_word=cp10

To:

"http://www.mydomain.com/search/[b]cp10[/b]/

cp10 is Request string

Thanks.
Last edited by Dr.CSS on Wed Feb 15, 2012 11:53 pm, edited 1 time in total.
Reason: Please use double quotes on fake links so they aren't clickable...
User avatar
manuel
Power Poster
Power Poster
Posts: 354
Joined: Fri Nov 30, 2007 9:15 am

Re: Plz help me config .htaccess file

Post by manuel »

Please look at the "doc" folder. Inside you will find a "CMSMS_config_reference.pdf" and "htaccess.txt".

adding the following line to the default config.php:
$config['url_rewriting'] = 'mod_rewrite';

and uncommenting the relevant lines in your .htaccess (copy the contents from the example "htaccess.txt") should suffice to get pretty URL's working.

Greetings,
Manuel
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Plz help me config .htaccess file

Post by Dr.CSS »

I don't know about rewrite rules, I just use the default in doc folder...

RewriteRule ^(.+)$ index.php?page=$1 [QSA]
RewriteRule ^(.+)$ ?key_word=$1 [QSA]
User avatar
angelpeace
Forum Members
Forum Members
Posts: 39
Joined: Fri May 15, 2009 9:45 am

Re: Plz help me config .htaccess file

Post by angelpeace »

Sorry, My full address is: "http://www.domain.com/index.php?page=search&key_word=[Request String value]

I Try to add after
...
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
RewriteRule ^(.+)$ ?key_word=$1 [QSA]

==> Result Error 500

Help plz. Thanks!
Last edited by Dr.CSS on Thu Feb 23, 2012 3:59 pm, edited 1 time in total.
Reason: Please use double quotes on fake links so they aren't clickable...
.: No gains without pains :.
Lee's Website: http://www.idev.com.vn;
Post Reply

Return to “The Lounge”