seo frienldy url is using cyrillic х character and it is always getting 404. How to fix it?
I have Seo friendly URL problem in my codeigniter web.
$route['(:any)'] = 'main/change_route/$1';
here is routes.php in a config folder. Any request must to call change_route method of the main class.
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class main extends CI_Controller {
public function change_route($url='')
{
die(urldecode($url));
}
}
This is my controller which is showing just request URL.
So my problem is here.
http://localhost/safety/black-shoes-ар-гутал
Above url is working correct and displaying that "black-shoes-ар-гутал"
But http://localhost/safety/black-shoes-хар-гутал this url is getting always 404. If i will remove cyrillic 'х' character from this URL so it will work correctly.
How can i fix it ?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
It is my .htaccess .
php codeigniter unicode seo friendly-url
New contributor
user3386540 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I have Seo friendly URL problem in my codeigniter web.
$route['(:any)'] = 'main/change_route/$1';
here is routes.php in a config folder. Any request must to call change_route method of the main class.
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class main extends CI_Controller {
public function change_route($url='')
{
die(urldecode($url));
}
}
This is my controller which is showing just request URL.
So my problem is here.
http://localhost/safety/black-shoes-ар-гутал
Above url is working correct and displaying that "black-shoes-ар-гутал"
But http://localhost/safety/black-shoes-хар-гутал this url is getting always 404. If i will remove cyrillic 'х' character from this URL so it will work correctly.
How can i fix it ?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
It is my .htaccess .
php codeigniter unicode seo friendly-url
New contributor
user3386540 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
• Maybe this helps: stackoverflow.com/a/11172396/2412335
– digijay
2 days ago
add a comment |
I have Seo friendly URL problem in my codeigniter web.
$route['(:any)'] = 'main/change_route/$1';
here is routes.php in a config folder. Any request must to call change_route method of the main class.
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class main extends CI_Controller {
public function change_route($url='')
{
die(urldecode($url));
}
}
This is my controller which is showing just request URL.
So my problem is here.
http://localhost/safety/black-shoes-ар-гутал
Above url is working correct and displaying that "black-shoes-ар-гутал"
But http://localhost/safety/black-shoes-хар-гутал this url is getting always 404. If i will remove cyrillic 'х' character from this URL so it will work correctly.
How can i fix it ?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
It is my .htaccess .
php codeigniter unicode seo friendly-url
New contributor
user3386540 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I have Seo friendly URL problem in my codeigniter web.
$route['(:any)'] = 'main/change_route/$1';
here is routes.php in a config folder. Any request must to call change_route method of the main class.
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class main extends CI_Controller {
public function change_route($url='')
{
die(urldecode($url));
}
}
This is my controller which is showing just request URL.
So my problem is here.
http://localhost/safety/black-shoes-ар-гутал
Above url is working correct and displaying that "black-shoes-ар-гутал"
But http://localhost/safety/black-shoes-хар-гутал this url is getting always 404. If i will remove cyrillic 'х' character from this URL so it will work correctly.
How can i fix it ?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
It is my .htaccess .
php codeigniter unicode seo friendly-url
php codeigniter unicode seo friendly-url
New contributor
user3386540 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
user3386540 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
user3386540 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 days ago
user3386540
62
62
New contributor
user3386540 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
user3386540 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
user3386540 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
• Maybe this helps: stackoverflow.com/a/11172396/2412335
– digijay
2 days ago
add a comment |
• Maybe this helps: stackoverflow.com/a/11172396/2412335
– digijay
2 days ago
• Maybe this helps: stackoverflow.com/a/11172396/2412335
– digijay
2 days ago
• Maybe this helps: stackoverflow.com/a/11172396/2412335
– digijay
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
In routes.php file, use change
$route['translate_uri_dashes'] = FALSE
this to
$route['translate_uri_dashes'] = TRUE;
and also in your config.php file change
$config['uri_protocol'] = 'REQUEST_URI';
to
$config['uri_protocol'] = 'PATH_INFO';
the uri will always be url-decoded
and if you want to remove controller name from your url use this
$route['^(method1 | method2 | method3)(/:any)?$'] = "controllerName/$0";
if your methods having underscore like
"function method_name(){
#yourcode
}"
than use this
$route['method-name'] ='controllerName/method_name';
if I hope all of my above example will help you
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
user3386540 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53945159%2fseo-frienldy-url-is-using-cyrillic-%25d1%2585-character-and-it-is-always-getting-404-how%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In routes.php file, use change
$route['translate_uri_dashes'] = FALSE
this to
$route['translate_uri_dashes'] = TRUE;
and also in your config.php file change
$config['uri_protocol'] = 'REQUEST_URI';
to
$config['uri_protocol'] = 'PATH_INFO';
the uri will always be url-decoded
and if you want to remove controller name from your url use this
$route['^(method1 | method2 | method3)(/:any)?$'] = "controllerName/$0";
if your methods having underscore like
"function method_name(){
#yourcode
}"
than use this
$route['method-name'] ='controllerName/method_name';
if I hope all of my above example will help you
add a comment |
In routes.php file, use change
$route['translate_uri_dashes'] = FALSE
this to
$route['translate_uri_dashes'] = TRUE;
and also in your config.php file change
$config['uri_protocol'] = 'REQUEST_URI';
to
$config['uri_protocol'] = 'PATH_INFO';
the uri will always be url-decoded
and if you want to remove controller name from your url use this
$route['^(method1 | method2 | method3)(/:any)?$'] = "controllerName/$0";
if your methods having underscore like
"function method_name(){
#yourcode
}"
than use this
$route['method-name'] ='controllerName/method_name';
if I hope all of my above example will help you
add a comment |
In routes.php file, use change
$route['translate_uri_dashes'] = FALSE
this to
$route['translate_uri_dashes'] = TRUE;
and also in your config.php file change
$config['uri_protocol'] = 'REQUEST_URI';
to
$config['uri_protocol'] = 'PATH_INFO';
the uri will always be url-decoded
and if you want to remove controller name from your url use this
$route['^(method1 | method2 | method3)(/:any)?$'] = "controllerName/$0";
if your methods having underscore like
"function method_name(){
#yourcode
}"
than use this
$route['method-name'] ='controllerName/method_name';
if I hope all of my above example will help you
In routes.php file, use change
$route['translate_uri_dashes'] = FALSE
this to
$route['translate_uri_dashes'] = TRUE;
and also in your config.php file change
$config['uri_protocol'] = 'REQUEST_URI';
to
$config['uri_protocol'] = 'PATH_INFO';
the uri will always be url-decoded
and if you want to remove controller name from your url use this
$route['^(method1 | method2 | method3)(/:any)?$'] = "controllerName/$0";
if your methods having underscore like
"function method_name(){
#yourcode
}"
than use this
$route['method-name'] ='controllerName/method_name';
if I hope all of my above example will help you
edited 2 days ago
answered 2 days ago
Utkarsh Tiwari
11
11
add a comment |
add a comment |
user3386540 is a new contributor. Be nice, and check out our Code of Conduct.
user3386540 is a new contributor. Be nice, and check out our Code of Conduct.
user3386540 is a new contributor. Be nice, and check out our Code of Conduct.
user3386540 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53945159%2fseo-frienldy-url-is-using-cyrillic-%25d1%2585-character-and-it-is-always-getting-404-how%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
• Maybe this helps: stackoverflow.com/a/11172396/2412335
– digijay
2 days ago