November 14, 200916 yr I just want to make sure I have this right... Options +FollowSymlinks RewriteEngine on RewriteRule ^display/(\w+)/$ post.php?p=$1 [nc]
November 14, 200916 yr Personally I'd put it in the IfModule tags just to be sure that the rewrite module is installed Options +FollowSymlinks <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^display/(\w+)/$ post.php?p=$1 [NC] </IfModule> and change the nc to NC but other than that it looks fine
November 14, 200916 yr Author hmmm, it's still not working. Does it have to be in the root? If it helps, I'm trying to get http://blog.jackbliss.co.uk/page.php?p=15 to look like http://blog.jackbliss.co.uk/post/16/ or even better http://blog.jackbliss.co.uk/16/ Is this even possible?
November 14, 200916 yr hmmm, it's still not working. Does it have to be in the root? If it helps, I'm trying to get http://blog.jackbliss.co.uk/page.php?p=15 to look like http://blog.jackbliss.co.uk/post/16/ or even better http://blog.jackbliss.co.uk/16/ Is this even possible? Options +FollowSymlinks <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^post/([0-9]+)$ page.php?p=$1 [NC] </IfModule> It needs to be placed in the root of your subdomain (httpdocs/public_html) on most hosts. Of course that's not going to include the trailing slash. If you wished to have it like http://yoursite.com/16 you'd need to take into account that the image/ css/ etc folders would be rewritten too, therefore they would not function. To solve this problem you'd need to add a conditional and off the top of my head it'd look something like this: Options +FollowSymlinks <IfModule mod_rewrite.c> RewriteEngine on RewriteCond $1 !^(images|css|style|index\.php) RewriteRule ^post/([0-9]+)$ page.php?p=$1 [L] </IfModule>
November 14, 200916 yr Author For me, I have the folder for my subdomain set up to be http://jackbliss.co.uk/blog/, so if you visit that it shows the exact same thing as when you are look at the subdomain. Can I just put the .htaccess file inside this folder? I don't seem to have a httpdocs folder in my root directory. Does it work if I just make one? I'm still kind of new to servers, I've never really touched a .htaccess before and I'm still learning. Sorry if I'm making any blaring mistakes.
November 14, 200916 yr For me, I have the folder for my subdomain set up to be http://jackbliss.co.uk/blog/, so if you visit that it shows the exact same thing as when you are look at the subdomain. Can I just put the .htaccess file inside this folder? I don't seem to have a httpdocs folder in my root directory. Does it work if I just make one? I'm still kind of new to servers, I've never really touched a .htaccess before and I'm still learning. Sorry if I'm making any blaring mistakes. That folder is fine.
November 14, 200916 yr Is the blog a wordpress installation? If so, simply put a blank .htaccess file in the same folder as the wp-config.php and then give it full write permissions (777). Then set the permalinks in the settings
November 14, 200916 yr Is the blog a wordpress installation? If so, simply put a blank .htaccess file in the same folder as the wp-config.php and then give it full write permissions (777). Then set the permalinks in the settings +1, this would be much better - wordpress allows you to have the blog title as the slug. Give it full write permissions and then change them back (refer to CHMOD). (0777)
November 15, 200916 yr Author no, sorry, its not. I wanted to see if I could do it my self, without wordpress. I know that wordpress is better, as it makes life a lot easier when doing this sort of thing, but I thought this would be better from a learning stand point.
November 15, 200916 yr Absolutely. I would suggest you take a look at the wordpress htaccess file however. You will see that it checks if a file or folder for the URI exists, and if not passes it to wordpress's index.php file which then processes the routing
Create an account or sign in to comment