Greetings friends,
I enable $config['assume_mod_rewrite'] = true; but noting different in my site, I want to redirect my url
for example: index.php?page=test ==> index.php/test
Anybody have idea about that and which file i put my coding also.
Thanks in advance,
Regards,
Kumaran
how to work: mod rewrite in cms
Re: how to work: mod rewrite in cms
The config file should look like this:
#------------
#URL Settings
#------------
#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = true;
#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '/';
#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism? This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = false;
#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy? (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;
#If using none of the above options, what should we be using for the query string
#variable? (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
And you have to put a file called .htaccess (without extention) in the root of your website with the following :
# Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
#RewriteCond %{REQUEST_URI} !/$
#RewriteCond %{REQUEST_URI} !\.
#RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Good luck
ID2020
#------------
#URL Settings
#------------
#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = true;
#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '/';
#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism? This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = false;
#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy? (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;
#If using none of the above options, what should we be using for the query string
#variable? (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
And you have to put a file called .htaccess (without extention) in the root of your website with the following :
# Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
#RewriteCond %{REQUEST_URI} !/$
#RewriteCond %{REQUEST_URI} !\.
#RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Good luck
ID2020
Re: how to work: mod rewrite in cms
Thanks for your great response.
I have one more doubt, Now I give the page name is for eg: About_us
Now I want redirect the page this format
www.sitename.com/About us
Can you give some idea about on that.
Regards
Kumaran
I have one more doubt, Now I give the page name is for eg: About_us
Now I want redirect the page this format
www.sitename.com/About us
Can you give some idea about on that.
Regards
Kumaran
Re: how to work: mod rewrite in cms
It automatically make's the page /about-us with a center line.
Don't know how to change this.
Mayby someone else knows.
Greetz ID2020
Don't know how to change this.
Mayby someone else knows.
Greetz ID2020
Re: how to work: mod rewrite in cms
Thanks Pierre,
I will check it.
I will check it.
Re: how to work: mod rewrite in cms
To my knowledge, spaces in urls are a no-no. Seems whenever you make a link with a space in it, it gets translated to %20. This is equivalent to doing urlencode on the space character. I could be wrong, in which case I want to know better - anyone, is this actually possible?
Re: how to work: mod rewrite in cms
I agree. It is unweby.oi_antz wrote: To my knowledge, spaces in urls are a no-no.
Pierre M.
Re: how to work: mod rewrite in cms
Thanks to all.
Its work fine....
Regards
Kumaran Paranthaman.
Its work fine....
Regards
Kumaran Paranthaman.