permalinks

How to create permalink in htaccess

自闭症网瘾萝莉.ら 提交于 2019-12-06 06:24:58
问题 I want to redirect a link to another with .htaccess file in Linux host. Can you help me? from: http://example.com/examp to: http://example.com/examp.php And another one for my other site from: http://example.com/examp to: http://example.com/user.php?u=examp 回答1: You will need mod_rewrite enabled for this. Start with placing these lines into .htaccess: RewriteEngine On RewriteBase / TBH I'm not 100% sure what do you mean exactly by permalink and how do you want to redirect, so I will provide 2

Configuring per-directory permalink settings in jekyll

爱⌒轻易说出口 提交于 2019-12-06 03:53:31
问题 Is it possible to have different permalink settings for different directories? For example, if I have a Jekyll setup where blog entries are written into /blog/_posts/ and news items in /news/_posts , then by default each entry will have permalinks in the format /blog/2011/06/24/slug.html and /news/2011/06/24/slug.html . The permalinks for blog entries are fine as they are, but I need to change the permalinks format for news to something different, say /news/2011/slug . I've tried changing the

Install WordPress in its own directory but permalink fails

空扰寡人 提交于 2019-12-06 02:33:59
问题 I installed WordPress on EC2, located in /var/www/html/wordpress . I followed the WordPress guide to copy index.php and .htaccess to root which is /var/www/html , and modified index.php and setting in admin panel. It works pretty well if I stick to only default link, such as: http://www.cubcanfly.com/?p=5 , however other permalink options fails, actually all of the permalink options. My .htaccess is # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\

Using Dates in Custom post_type Permalinks in Wordpress 3.0

血红的双手。 提交于 2019-12-06 01:28:47
问题 I'm adding a custom post_type to Wordpress, and would like the permalink structure to look like this: /%post_type%/%year%/%monthnum%/%postname%/ I can't figure out how to add the date tags. Using this code, gives me /my_type/example-post-slug/ : register_post_type( 'customtype', array( ...other options... 'rewrite' => array('slug' => 'my_type'), )); How do I include the dates? 回答1: You can achieve this with the plugin Custom Post Type Permalinks. Just install the plugin and change the

Different permalink structure for blog posts than pages in Wordpress?

痴心易碎 提交于 2019-12-05 22:39:45
问题 I'd like to have a different permalink structure for posts than for pages on a Wordpress website. For example, a blog post name "This is a nice blog post" would get the permalink : /blog/this-is-a-nice-blog-post where as a page called "Services Offered" would get the permalink : /services-offered I know I should use the %postname% in the permalink structure, but how to add the prefix /blog/ to only those blog posts ? Thanks in advance! 回答1: Under the permalink settings, you need to use a

Best Permalinking for Rails

只谈情不闲聊 提交于 2019-12-05 15:02:56
What do you think is the best way to create SEO friendly URLs (dynamically) in Rails? Override the to_param method in your model classes so that the default numeric ID is replaced with a meaningful string. For example, this very question uses best-permalinking-for-rails in the URL. Ryan Bates has a Railscast on this topic . ActiveSupport has a new method in Rails to aid this - String#parameterize. The relevant commit is here ; the example given in the commit message is "Donald E. Knuth".parameterize => "donald-e-knuth" In combination with the to_param override mentioned by John Topley, this

Wordpress Permalinks never work on localhost Ubuntu 12.10

柔情痞子 提交于 2019-12-05 10:33:35
Wordpress permalinks aren't working, except for the default. How do I enable this rewriting? I've tried: sudo a2enmod rewrite sudo service apache2 restart The permalinks are saving to the .htaccess in /localhost/wordpress: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wordpress/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wordpress/index.php [L] </IfModule> # END WordPress and I copy to root /var/www just to try, and it doesn't make any difference. I had also tried the AllowOverwride All, but

How WordPress permalink system works?

大兔子大兔子 提交于 2019-12-05 10:15:50
I am a php developer and i am currently developing a CMS/blog system. i want to add a permalink system like WordPress. i am curious about how WordPress parse permalink. For example, how to get data like id and post name from: example.com/id/123/post/example/ In short, I want a system to get id and post name from the url. I want to enable users to change the permalink structure like WordPress using tags like: id/%postid%/post/%postname%/ How do I get data in variables like $id and $post_name where values will 123 and example ? Please help me. Thanks in advance. The commonly available apache

Wordpress is ignoring Unicode Chars in URL

瘦欲@ 提交于 2019-12-05 09:40:38
问题 I am using wordpress with this type of permalink: /%year%/%monthnum%/%postname%/ if I use this type of url: example.com/2010/03/तकनीक it treats this url like this example.com/2010/03/ (By ignoring unicode chars) and displays March 2010 archive list. if I use english url: example.com/2010/03/technology then it works perfectly. This problem occurs even on tags page: for example example.com/tag/इंटरनेट is treated like example.com/tag/ and displays 404 page. Why wordpress is ignoring unicode

Show only specific categories in permalinks for custom post type in WordPress

大城市里の小女人 提交于 2019-12-05 06:30:39
I tried to ask this question in the Wordpress Devlopment network with no success, I'm trying to display only 3 specific categories in permalinks for custom-post-type categories. Right now the permalinks structure (that is the structure given by the theme i'm using and that i'm modifying through a child theme)is as follows: www.myfoodblog.com/recipes/the-post-title/ ^ ^ ^ root custom-post-type title some post are under 3 categories that i would like to display in permalinks which are restaurant , users and admin to get something like this www.myfoodblog.com/recipes/restaurant/the-post-title/