Welcome Guest, Not a member yet? Register   Sign In
How to leaves old link - routing?
#1

[eluser]devastator[/eluser]
Hello, i'm new here and for first time i will use codeigniter because he is very easy to use and have SUPRB user guide. Now my problem i have my old site he have very very good positions in google for long keywords and url are article.php?id=article_id i want to leaves them that only this url for articles all other to be dada/dada/213 how to make that? I put this routing
Code:
$route['article.php?id=(:num)'] = "article/index/$1";
but still not work i have 404 page error and I have article controller and index method with param $id
#2

[eluser]cahva[/eluser]
I dont think you can do that with routes as it is used (to my knowledge) what happens AFTER index.php.
Use .htaccess and 301 redirect(with mod_rewrite) instead.
#3

[eluser]Cro_Crx[/eluser]
You need to enable query strings in your config.php file. It will be set to false, so set to true.

Having clean URL's will help your website rankings in the long term, so leaving the URL's as is just for the rankings is silly because it will end up hurting your rankings eventually compared to clean URL's.
#4

[eluser]devastator[/eluser]
I use this redirect

RewriteRule ^article.php?id=(.*)$ /article/index/$1 [L]

but not work
changing config file also don't work

My site have 10 000 uniques per day 90% of them are form google that articles are in first-five positions. I want to not change the urls because google will reindexing me 2-3 months and visits will be more more lower.

I try everything that i know and think will work. Please help me to hardcode that.
#5

[eluser]devastator[/eluser]
Can someone help me?
#6

[eluser]n0xie[/eluser]
Did you try this?

Code:
RewriteRule ^article.php?id=(.*)$ index.php/article/index/$1 [L]
#7

[eluser]devastator[/eluser]
Yes and still got 404 page not found...
#8

[eluser]n0xie[/eluser]
Are you sure mod_rewrite is enabled?
#9

[eluser]devastator[/eluser]
Yup i remove index.php with him

that is all my htaccess file

Code:
Options +FollowSymlinks -Indexes
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|robots\.txt|sitemap\.xml)
RewriteRule ^(.*)$ index.php/$1 [L]
RewriteRule ^article.php?id=(.*)$ /article/index/$1 [NC,L]

I think it's need to edit routes.php file and i set this
Code:
$route['article.php?id=(:num)'] = "article/index/$1";
and in config.php i set this
Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
to this
Code:
$config['permitted_uri_chars'] = '';
and STILL i get 404 page not found O_O

in log file i get this
Code:
DEBUG - 2010-02-21 03:31:12 --> Config Class Initialized
DEBUG - 2010-02-21 03:31:12 --> Hooks Class Initialized
DEBUG - 2010-02-21 03:31:12 --> URI Class Initialized
ERROR - 2010-02-21 03:31:12 --> 404 Page Not Found --> id
#10

[eluser]n0xie[/eluser]
Put the RewriteRule above your other RewriteRules.




Theme © iAndrew 2016 - Forum software by © MyBB