Page 1 of 1

redirecting URLS in CMS

Posted: Thu Apr 12, 2007 6:35 pm
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

Re: redirecting URLS in CMS

Posted: Thu Apr 12, 2007 6:59 pm
by mahjong
http://www.webweaver.nu/html-tips/web-redirection.shtml

Code: Select all

Redirect 301 /oldpage.html http://www.example.com/newpage.html

Re: redirecting URLS in CMS

Posted: Thu Apr 12, 2007 7:03 pm
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

Re: redirecting URLS in CMS

Posted: Thu Apr 12, 2007 7:36 pm
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

Re: redirecting URLS in CMS

Posted: Thu Apr 12, 2007 8:05 pm
by Nullig
How about if you try:

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

Nullig

Re: redirecting URLS in CMS

Posted: Thu Apr 12, 2007 9:49 pm
by soulja90
that would defeat the purpose as search engines find /name urls better than ?=whatever

Thanks  for the insight tho

Re: redirecting URLS in CMS

Posted: Thu Apr 12, 2007 9:52 pm
by heatherfeuer
By the time you get the redirect working, most search engines should have crawled your new pages anyway.

Re: redirecting URLS in CMS

Posted: Thu Apr 12, 2007 10:34 pm
by mahjong
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ /index.php?page=$1 [QSA,L]

Re: redirecting URLS in CMS

Posted: Thu Apr 12, 2007 11:55 pm
by soulja90
the slash before the index was a good idea but didn't work.

:)

Thanks for the input tho

JB

Re: redirecting URLS in CMS

Posted: Fri Apr 13, 2007 4:04 am
by mahjong
What happened?

Re: redirecting URLS in CMS

Posted: Fri Apr 13, 2007 4:27 am
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!

Re: redirecting URLS in CMS

Posted: Fri Apr 13, 2007 1:18 pm
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.

Re: redirecting URLS in CMS

Posted: Fri Apr 13, 2007 9:43 pm
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!

Re: redirecting URLS in CMS

Posted: Fri Apr 13, 2007 11:20 pm
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;