permalinks

Generation of _id vs. ObjectId autogeneration in MongoDB

流过昼夜 提交于 2019-12-01 08:14:56
问题 I'm developing an application that create permalinks. I'm not sure how save the documents in MondoDB. Two strategies: ObjectId autogeneration MongoDB autogenerates the _id . I need to create an index on the permalink field because I get the information by the permalink. Also I can access to the creation time of the ObjectId, using the getTimestamp() method, so datetime fields seems to be redundant but if I delete this field I need two calls to MongoDB one to take the information and another

.htaccess fix for a pretty permalink in PHP?

自作多情 提交于 2019-12-01 01:23:46
Maybe I'm going about this in the wrong way, but I have some pages in our homegrown CMS that I want to convert to using pretty permalinks. Currently, their page URLs look this this: http://ourdomain.com/articles/?permalink=blah-blah-blah I want to convert these to: http://ourdomain.com/articles/blah-blah-blah I have a column in the db for permalinks, that when the article is created, automatically converts the title to a permalink. How would I write the rewrite rule to accomplish this? Is this even the best way to accomplish this? If there's nothing in the query string you can omit QSA :

Django Inheritance and Permalinks

為{幸葍}努か 提交于 2019-12-01 01:03:12
I'm creating a simple CMS in django, with multiple "modules" (each as a django app). I've set up the following models: class FooObject(models.Model): id = models.SlugField(primary_key=True) name = models.CharField(max_length=255) creator = models.ForeignKey(auth.models.User, editable=False, related_name="createdby") class FooPage(FooObject): content = models.TextField(blank=True, null=True) @models.permalink def get_absolute_url(self): return ('page', (), {'page_id':self.id} class FooSubitem(FooObject): parent = models.ForeignKey(FooPage, related_name='subitems') In each of the modules, I

Remove directory name from url Wordpress

匆匆过客 提交于 2019-11-29 07:40:46
I have a website on www.example.com. On that domain Wordpress website is in directory wp . So to access my wordpress website you should go to www.example.com/wp and that is the main website. In root i have index.html where you choose language and then go to Wordpress website What i need sounds simple! :) I want to remove wp from url using .htaccess or whatever else could do the trick, so when browse Wordpress website it shouild work without wp ! I must note that website must stay in wp folder! Is this achievable? 1) in your dashboard, go to settings -> general and make sure a) wordpress

Remove index.php from wordpress URLs in iis7

蓝咒 提交于 2019-11-29 04:14:44
I want to remove index.php from url , i am using wordpress and iis7 . how can i do this Use this web.config (web.config is the IIS equivalent to .htaccess file in apache webservers. It can be found in the root folder. If there is none, you need to create one.) <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <defaultDocument> <!-- Set the default document --> <files> <remove value="index.php" /> <add value="index.php" /> </files> </defaultDocument> <httpErrors errorMode="Detailed"/> <rewrite> <rules> <rule name="wordpress" patternSyntax="Wildcard"> <match url="*" />

wordpress permalinks not working - htaccess seems ok but getting 404 error on pages

房东的猫 提交于 2019-11-28 17:29:23
I updated the permalink structure to /%postname%/ and this updated my .htaccess with: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress But I still get 404 errors on the pages. Are there any other settings that I need to change? Edit: if it helps the apache log seems to be looking directly in the permalinked folder. I.e.: [Wed Oct 16 11:12:32 2013] [error] [client xx.xx.xx.xxx] File does not exist: /var/www

Custom permalink structure: /%custom-post-type%/%custom-taxonomy%/%post-name%/

◇◆丶佛笑我妖孽 提交于 2019-11-28 16:44:15
I'm trying to create a custom permalink structure that will allow me to accomplish the following. I have a custom post type called "projects" I have a custom taxonomy called "project-category" that is assigned to the CPT "projects" I want my permalink structure to look like this: projects/category/project-name or /%custom-post-type%/%custom-taxonomy%/%post-name%/ I've been able to succesfully use /%category%/ in permalinks for normal, out-of-the-box WP posts, but not for CPTs. How would creating such a permalink structure affect the URLs or other pages? Is it possible de define a custom

Wordpress Custom Permalink for Just Posts

风格不统一 提交于 2019-11-28 09:11:27
My Wordpress install has three post types: pages, posts, and portfolio. The current structure is as follows: page: example.com/page-name , post listing page: example.com/blog , individual post : example.com/post-name , portfolio listing page: example.com/portfolio , individual portfolio post: example.com/portfolio/portfolio-name . The thing I'd like to change is the individual post permalink, but nothing else. I'd like it to become example.com/blog/post-name. I can't find documentation that shows how to make this change without affecting the other types. EDIT : My current permalink structure

Redirect URL to custom URL through .htaccess

一笑奈何 提交于 2019-11-28 09:05:28
问题 I've got a page www.mypage.com and I want to redirect specific URL to another URL that does not exist. For example, I want www.mypage.com/about to redirect to www.mypage.com/about-company.php , where /about does not exists - it's a custom URL written by me. I've got no dynamic URL, only want to tell through .htaccess "this /CUSTOM_URL redirect to this /URL.php". In the URL bar, it must show the custom url . I don't know if it can be done. I've looked for it and all I've found are ways to

Remove directory name from url Wordpress

旧巷老猫 提交于 2019-11-28 01:01:30
问题 I have a website on www.example.com. On that domain Wordpress website is in directory wp . So to access my wordpress website you should go to www.example.com/wp and that is the main website. In root i have index.html where you choose language and then go to Wordpress website What i need sounds simple! :) I want to remove wp from url using .htaccess or whatever else could do the trick, so when browse Wordpress website it shouild work without wp ! I must note that website must stay in wp folder