URL rewriting and redirect - problem

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
User avatar
DirtyMusic
Forum Members
Forum Members
Posts: 15
Joined: Sat Nov 08, 2008 9:27 am

URL rewriting and redirect - problem

Post 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?
irish
Forum Members
Forum Members
Posts: 101
Joined: Tue Jun 03, 2008 2:31 pm

Re: URL rewriting and redirect - problem

Post 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]

User avatar
DirtyMusic
Forum Members
Forum Members
Posts: 15
Joined: Sat Nov 08, 2008 9:27 am

Re: URL rewriting and redirect - problem

Post by DirtyMusic »

Yes, I have added the .htaccess and edit the config.php
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: URL rewriting and redirect - problem

Post 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
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
DirtyMusic
Forum Members
Forum Members
Posts: 15
Joined: Sat Nov 08, 2008 9:27 am

Re: URL rewriting and redirect - problem

Post 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?
Pierre M.

Re: URL rewriting and redirect - problem

Post 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.
Locked

Return to “[locked] Installation, Setup and Upgrade”