Page 1 of 1
URL rewriting and redirect - problem
Posted: Wed Sep 09, 2009 7:12 pm
by DirtyMusic
I have for a long time use a URL like this index.php?mact=News,cntnt01,detail,0&cntnt01articleid=47&cntnt01returnid=75 I have reinstalled CMS and made a new structure with new and the URL is now /news/74/47/title
When someone tries to visist the first URL it only show a white page. How can I get the visitors that use old URLs to the new one? Or at least make them visist my news-page?
Re: URL rewriting and redirect - problem
Posted: Thu Sep 10, 2009 9:49 am
by irish
Did you add this to your .htaccess file?
Code: Select all
Options +FollowSymLinks
RewriteEngine on
# 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
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Re: URL rewriting and redirect - problem
Posted: Thu Sep 10, 2009 2:29 pm
by DirtyMusic
Yes, I have added the .htaccess and edit the config.php
Re: URL rewriting and redirect - problem
Posted: Thu Sep 10, 2009 3:33 pm
by Rolf
Hi DirtyMusic,
config.php
Code: Select all
#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'] = false;
false -> index.php?mact=News,cntnt01,detail,0&cntnt01articleid=47&cntnt01returnid=75
true -> /news/74/47/title
But there have been some changes here, don't know for sure if this option is still there in the latest versions.
Regards, Rolf
Re: URL rewriting and redirect - problem
Posted: Thu Sep 10, 2009 5:08 pm
by DirtyMusic
I think I have to ask the question again. I have followed the tutorial on how to change the config.php and how to make the .htaccess and it's working perfect.
I want visitors who use the old URL (index.php?mact=News,cntnt01,detail,0&cntnt01articleid=47&cntnt01returnid=75) to go to the new URL (/news/74/47/title). But now they just sees a white page. How to solve this?
Re: URL rewriting and redirect - problem
Posted: Tue Sep 22, 2009 11:51 am
by Pierre M.
Hello,
there are two topics here :
1-exposing pretty URLs to the web (for pages, for news...),
2-migrating the web from an old URL scheme to a new one.
You have found the CMSms specific tutorial for topic1. You have pretty page URL and news URL ? Cool.
Topic2 is not CMSms specific. It is about the webserver redirecting (301) the old URLs to the new ones.
Yes, a CMSms tip could help to provide the old-to-new rewrite mapping. May be a unique rewrite rule can do it, if 74==75.
Pierre M.