redirecting URLS in CMS

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
soulja90
Forum Members
Forum Members
Posts: 83
Joined: Tue Mar 13, 2007 10:56 pm

redirecting URLS in CMS

Post by soulja90 »

Hi,

I just moved my .html original site to the CMS Made Simple CMS.

VERY HAPPY WITH CMSMS

I would like to know how I can redirect my individual pages (.html)

to the new pages on CMSMS that I created.

The issue I'm having is with the current .htaccess file.

I would like to use a 301 redirect.

Thanks

JB
mahjong

Re: redirecting URLS in CMS

Post by mahjong »

http://www.webweaver.nu/html-tips/web-redirection.shtml

Code: Select all

Redirect 301 /oldpage.html http://www.example.com/newpage.html
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: redirecting URLS in CMS

Post by Nullig »

You can redirect by placing this code in your .htaccess file:

Code: Select all

 redirect 301 /old/old.html http://www.you.com/new.php
Nullig
soulja90
Forum Members
Forum Members
Posts: 83
Joined: Tue Mar 13, 2007 10:56 pm

Re: redirecting URLS in CMS

Post by soulja90 »

Hi Yall,

I tried that method before but I keep getting a file not found error, plus I noticed the url looks different (has a this part ?page=), which doesn't make it redirect.

Here is how my .htacess looks right now:

redirect 301 /Electronics-Dropshippers.html http://www.wdclub.com/articles/dropship ... pshippers/

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]

So after this when you go to http://www.wdclub.com/Electronics-Dropshippers.html it looks like below with file not found:

http://www.wdclub.com/articles/dropship ... ppers.html
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: redirecting URLS in CMS

Post by Nullig »

How about if you try:

redirect 301 /Electronics-Dropshippers.html http://www.wdclub.com/index.php?page=el ... opshippers

Nullig
soulja90
Forum Members
Forum Members
Posts: 83
Joined: Tue Mar 13, 2007 10:56 pm

Re: redirecting URLS in CMS

Post by soulja90 »

that would defeat the purpose as search engines find /name urls better than ?=whatever

Thanks  for the insight tho
heatherfeuer

Re: redirecting URLS in CMS

Post by heatherfeuer »

By the time you get the redirect working, most search engines should have crawled your new pages anyway.
mahjong

Re: redirecting URLS in CMS

Post by mahjong »

RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ /index.php?page=$1 [QSA,L]
soulja90
Forum Members
Forum Members
Posts: 83
Joined: Tue Mar 13, 2007 10:56 pm

Re: redirecting URLS in CMS

Post by soulja90 »

the slash before the index was a good idea but didn't work.

:)

Thanks for the input tho

JB
mahjong

Re: redirecting URLS in CMS

Post by mahjong »

What happened?
soulja90
Forum Members
Forum Members
Posts: 83
Joined: Tue Mar 13, 2007 10:56 pm

Re: redirecting URLS in CMS

Post by soulja90 »

same thing - not found error

and the url is still like this:

http://www.wdclub.com/articles/dropship ... ppers.html

However:

I found something that might help the experts here figure something out:

have a look at this:

http://www.webconfs.com/url-rewriting-tool.php

you enter a url and it tells you what to do - i'm still tryin to figure this out but if you can help please. Thanks!
Last edited by soulja90 on Fri Apr 13, 2007 5:06 am, edited 1 time in total.
Pierre M.

Re: redirecting URLS in CMS

Post by Pierre M. »

Hello, I hope I understand well...

I see two separate things here :
1°)Making the new site work with pretty URLs. Make this work FIRST.
2°)301 redirect the old URLs to the new ones.

The first is easy, just RTFM ;-)
My advice : choose ".html" ending URLs. (you should take it, this was your choice for your old static site).

The second is the borring one. On your old hosting location you must write a long N lines .htaccess :
Redirect 301 /path/to/old/page1.html /the/new/URL/to/page1.html
Redirect 301 /another/path/to/page2.html /the/other/URL/to/new/page2.html
...
Redirect 301 /path/to/last/pageN.html /the/new/last/URL/to/last/pageN.html
as others have said.
This comes first in the .htaccess, before the rewrites (as you seems to be on the same host). But only AFTER the new pretty URLs are working.

Pierre M.
soulja90
Forum Members
Forum Members
Posts: 83
Joined: Tue Mar 13, 2007 10:56 pm

Re: redirecting URLS in CMS

Post by soulja90 »

Hi,

I already had seo friendly urls

it just wasnt happeniung - so i changed the seo friendly urls to .htm and it worked than

I guess thats friendly enough hehe

THanks!
mahjong

Re: redirecting URLS in CMS

Post by mahjong »

Check your config.php file. It might be at the source of this weird problem.

$config['assume_mod_rewrite'] = true;
$config['page_extension'] = 'html';
$config['use_hierarchy'] = true;
Last edited by mahjong on Fri Apr 13, 2007 11:22 pm, edited 1 time in total.
Post Reply

Return to “CMSMS Core”