clean-urls

using seo user friendly in php

 ̄綄美尐妖づ 提交于 2019-11-27 15:53:23
this is the URL path I currently use: /index.php?page=1&title=articles I want to get the URL path as /index/page-1/title-articles using SEO user friendly URLs in PHP. And how to get the value of the "title"? Any one can help me pls. Check out the mod_rewrite module , and maybe for a good starting point, this tutorial on how to take advantage of it with PHP. You need to ensure two things: your application prints out the new URLs properly, and your webserver can understand that new URLs and rewrites them to your internal scheme or redirects them back to your application and your application does

Using slugs in codeigniter

倖福魔咒の 提交于 2019-11-27 12:29:39
I have heard of people using slugs for generating clean urls. I have no idea how it works. Currently i have a codeigniter site which generates url's like this www.site.com/index.php/blog/view/7 From what i understand by maintaining a slug field it is possible to achieve urls like www.site.com/index.php/blog/view/once-upon-a-time How is this done? Especially in reference to codeigniter? I just store the slugs in my database table, in a column called slug , then find a post with the slug, like this: public function view($slug) { $query = $this->db->get_where('posts', array('slug' => $slug), 1);

Handle $_GET requests with Clean URLs

元气小坏坏 提交于 2019-11-27 08:47:49
问题 I am have a clear URL based system so the categories will be shown like this http://www.mysite.com/category/23/cat-name Inside the categories page I have some sorting and pages options such as sorting by latests and lower price. Also, I have a pages navigation system The problem is when the request is happening inside the page the $_GET[] doesn't show the variables I need. However it shows in the URL as http://www.mysite.com/category/23/cat-name?page=3 The $_GET variable only shows the id of

How does one encode and decode a string with Python for use in a URL?

偶尔善良 提交于 2019-11-27 04:47:18
问题 I have a string like this: String A: [ 12234_1_Hello'World_34433_22acb_4554344_accCC44 ] I would like to encrypt String A to be used in a clean URL. something like this: String B: [ cYdfkeYss4543423sdfHsaaZ ] Is there a encode API in python, given String A, it returns String B? Is there a decode API in python, given String B, it returns String A? 回答1: One way of doing the encode/decode is to use the package base64, for an example: import base64 import sys encoded = base64.b64encode(sys.stdin

Clean URLs for search query?

落花浮王杯 提交于 2019-11-27 02:06:42
This works: HTML <a href="/search/querystring">query</a> htaccess RewriteRule ^search/([-0-9a-z]+)$ /search.php?q=$1 [L] Going through a search form: <form method="get" action="/search"> <input type="search" name="q" value="querystring" /> <input type="submit" /> </form> Result: http://example.com/search?q=querystring Desired result: http://example.com/search/querystring Is this possible with htaccess or do I need to redirect with PHP from within search.php? Example desired result in action: http://twitter.com/search/hello EDIT I prefer not to be dependant on JavaScript to do this so search

Enable clean URL in Yii2

别等时光非礼了梦想. 提交于 2019-11-26 21:35:28
How can I enable clean urls in Yii2. I want to remove index.php and '?' from url parameters. Which section needs to be edited in Yii2 for that? user7282 I got it working in yii2. Enable mod_rewrite for Apache . For basic template do the following: Create a .htaccess file in web folder and add this RewriteEngine on # If a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Otherwise forward it to index.php RewriteRule . index.php Then inside config folder, in web.php add to components 'urlManager' => [ 'class' => 'yii\web

Using slugs in codeigniter

痴心易碎 提交于 2019-11-26 16:05:04
问题 I have heard of people using slugs for generating clean urls. I have no idea how it works. Currently i have a codeigniter site which generates url's like this www.site.com/index.php/blog/view/7 From what i understand by maintaining a slug field it is possible to achieve urls like www.site.com/index.php/blog/view/once-upon-a-time How is this done? Especially in reference to codeigniter? 回答1: I just store the slugs in my database table, in a column called slug , then find a post with the slug,

How to version REST URIs

不打扰是莪最后的温柔 提交于 2019-11-26 11:58:50
What is the best way to version REST URIs? Currently we have a version # in the URI itself, ie. http://example.com/users/v4/1234/ for version 4 of this representation. Does the version belong in the queryString? ie. http://example.com/users/1234?version=4 Or is versioning best accomplished another way? I would say making it part of the URI itself (option 1) is best because v4 identifies a different resource than v3. Query parameters like in your second option can be best used to pass-in additional (query) info related to the request , rather than the resource . Darrel Miller Do not version

Clean URLs for search query?

折月煮酒 提交于 2019-11-26 09:55:57
问题 This works: HTML <a href=\"/search/querystring\">query</a> htaccess RewriteRule ^search/([-0-9a-z]+)$ /search.php?q=$1 [L] Going through a search form: <form method=\"get\" action=\"/search\"> <input type=\"search\" name=\"q\" value=\"querystring\" /> <input type=\"submit\" /> </form> Result: http://example.com/search?q=querystring Desired result: http://example.com/search/querystring Is this possible with htaccess or do I need to redirect with PHP from within search.php? Example desired

Enable clean URL in Yii2

[亡魂溺海] 提交于 2019-11-26 07:22:54
问题 How can I enable clean urls in Yii2. I want to remove index.php and \'?\' from url parameters. Which section needs to be edited in Yii2 for that? 回答1: I got it working in yii2. Enable mod_rewrite for Apache . For basic template do the following: Create a .htaccess file in web folder and add this RewriteEngine on # If a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Otherwise forward it to index.php RewriteRule . index.php