didi
Posts: 6
|
Posted: 11/28/2012, 7:20 PM |
|
hi all, is it possible to create httaccces on ccs? help me please
|
|
|
saseow
Posts: 744
|
Posted: 11/29/2012, 3:29 AM |
|
It is just a text file so do it in notepad or something. CCS does not create them but naturally you can include it in your project.
|
|
|
didi
Posts: 6
|
Posted: 12/01/2012, 10:19 PM |
|
hi saseow thanks for your reply, i know its just text file but how to create statement like this on .httacces
RewriteRule ^categories-(.*)\.html$ media.php?module=Detail&id=$1 [L]
how to create parameter and id on ccs
"<li id='cat'><a href=categories-$k[id_categories]-$k[categories_seo].html title='Ada $k[jml] berita pada kategori $k[nama_kategori]'>
|
|
|
saseow
Posts: 744
|
Posted: 12/02/2012, 12:10 AM |
|
didi, I have never done this before and I don't see how you could do it as the data you are needing is all dynamic. I don't think it is possible to have an htaccess file changing all the time. I am just not sure.
Sorry,
Trevor
|
|
|
bannedone
Posts: 273
|
Posted: 12/02/2012, 5:59 PM |
|
Hi
This can be a rather thorny subject. I hope I can explain it properly for you
The .htaccess rewrite rules are basically regular expresions where you can replace strings in a URL with values of your choice.
Here is an example
RewriteRule ^(.*)page/(.*)/(.*)/$ $1yourpage.php?yourparam=$2 [L]
this part ^(.*)page/ specifies to find the string page/ (,*) will be placed in the $1 variable
this part (.*)/ Selects the second slash position as $2 variable
The next one like that Is Variable $3 (Not Used in this example).
The next piece after the 1st $ is what will be rewritten to the url.
So if your URL was http://whatever.com/page/1/any_text/ will be re-written to
Using $1 variable (all stuff before page/) and $2 variable(the value between the next slashes) it will become
http://whatever.com/yourpage.php?yourparam=1
So Using Your Rule
RewriteRule ^categories-(.*)\.html$ media.php?module=Detail&id=$1 [L]
with this URL
<a href='categories-$k[id_categories]-$k[categories_seo].html' title='Ada $k[jml] berita pada kategori $k[nama_kategori]'>
Will Probably not work.
First thing you need to realize is the when using mod_rewrite all URLs need to be fully qualified. By the I mean they must have http://the_doman_name in the href. This also iincludes any images or scripts or style sheets being included on the page.
What I have done to test re-write rules is insoect the apcahe error logs to try and determine how the re-write rule is modifying the URL
Hope this helps
BTW you can see an example of how I implemented .htaccess re-write rules in my Code Charge CMS implementing SEO Friendly URLs. http://demo.ccselite.com/ccsCMS5 . Your will see all URLs in this system are using mod-rewrite.
Have Fun
_________________
John Real
CodeCharge Studio Support, Training, Consulting, Development, Web based solutions
http://realsites.biz
http://ccselite.com
Other Banned IDs on this Forum. jjrjr1, jjrjr2 |
|
|
|