0

Currently my URLs look like this

http://www.domain12.co.un/register/user/A123

I want to remove /register/user/ from URL So, It should look something like this.

http://www.domain12.co.un/A123

Parameter A123 is not constant in above URL, It may change B123, G123, 3FG567... etc.

I gone through this but getting 404 error. I have added below code in my routes.php but it's not redirecting to other page.

 $route['(:any)'] = "register/user/$1";

7
  • you remove index.php in config.php ?? Commented Jul 5, 2017 at 12:07
  • Already removed , but not working . here its $config['index_page'] = ''; Commented Jul 5, 2017 at 12:13
  • your method pass any argument in controller ??? Commented Jul 5, 2017 at 12:16
  • @HothiJimit Yes Commented Jul 5, 2017 at 12:18
  • default set null like function demo($arg=null) Commented Jul 5, 2017 at 12:21

1 Answer 1

1

Do one more thing..

Create .htaccess file and paste the below code

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L] 
</IfModule>

and save this .htaccess file in your root folder and then try

Sign up to request clarification or add additional context in comments.

4 Comments

Added code in .htaccess file. No luck. I have login form in above url and once I logged It is not redirecting to secure(dashboard) page. but URL is changed like this www.domain12.co.un/dashboard but here it showing my login page design
All the pages(about Us, Terms and Condition.. etc) showing the same design
Try with this code : $route['user/(:any)'] = 'register/user/$1';
Getting 404 page errror

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.