Welcome Guest, Not a member yet? Register   Sign In
Quick .htaccess question
#1

[eluser]coding_hero[/eluser]
Hi all. I have a quick .htaccess question. I know regex, but I still have problems writing an .htaccess file. Here's what's on my site right now:

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|media|images|css|js|include|blog|out)
RewriteRule ^(.*)$ /index.php/$1 [L]

AddType x-mapp-php5 .php

I'd like to add the ability for the user to go to http://<domainname>.com/<post_id> and arrive at http://<domainname>.com/search/post/<post_id>. So, basically, I just need to capture any ([0-9]+) after the /, and redirect to /search/post/$1 (and still hide the index.php).

I'm sending links as text messages, and every character helps.

Thanks!
#2

[eluser]Dam1an[/eluser]
Wouldn't it be easier to do this using CI routes? Lookup URI routing in the userguide for how it works
#3

[eluser]coding_hero[/eluser]
Forgot all about those. That worked great, thanks!




Theme © iAndrew 2016 - Forum software by © MyBB