Page 1 of 1

Symlink Blog Post

Posted: Sun Oct 07, 2012 2:33 am
by FrederickGeek8
I have absolutely no idea how to do this but how can I symlink blog posts like they do in wordpress so it would look like
read.php?aid=16

to
/look-at-me/

or
/look-at-me-2/

Re: Symlink Blog Post

Posted: Sun Oct 07, 2012 2:47 am
by Helx
Its .htaccess (Mod_rewrite)

[syntax=text]# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /b/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>

# END WordPress[/syntax]

Re: Symlink Blog Post

Posted: Sun Oct 07, 2012 3:33 am
by FrederickGeek8
I am really confused on this. How would I link post id 16 to /hello-world/ and post id 17 to /hello-people/ and stuff.... I would really like to understand this really

Re: Symlink Blog Post

Posted: Sun Oct 07, 2012 3:42 am
by Helx
Well, the /hello-world/ would be a $_GET variable, so you could just use that in your script to find it in a DB

I really don't know, I just found the .htaccess :3

EDIT: found an easier one to understand
[syntax=text]RewriteEngine On
RewriteRule ^aid/([a-zA-Z0-9_-]+)$ index.php?aid=$1[/syntax]

if you had website.com/blog/?aid=43, you'd be able to navigate to website.com/blog/aid/43
Its the same concept as the ?aid= thing. You can still echo $_GET['aid'];