harsh8888
harsh8888

Reputation: 477

domain.com/username mod rewrite in codeigniter

I'm new to mode rewrite thing. Started off with codeigniter a couple of days back and trying to get a hand at it. I'm developing a website which needs domain.com/USERNAME for better SEO results. But I'm unable to figure out as to what mod rewrite I should write to achieve this. I already have removed the index.php entry in config and my base url is http://127.0.0.1/myproject/. (I'm using XAMPP) So I have to search for username in this format

http://127.0.0.1/myproject/USERNAME

and return the corresponding page. My current mod rewrite file goes as follows :

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Any suggestions? Thank you for your help :-)

Upvotes: 0

Views: 280

Answers (1)

Tejas
Tejas

Reputation: 2475

http://daparky.com/codeigniter-vanity-username-personalised-urls/

this should solve your problem.

Upvotes: 1

Related Questions