Sunday 15 September 2013

Clean URL assistance php/.htaccess -


"postprint" itemprop = "text">

I'm looking to make some cleaner URLs so that it looks basically, the web address looks good.

Currently my URL looks like this .. ... co.uk/article.php?sport=football&id=23 .. & amp; The title for this post may be .. ERM. "This is the title"

I've made the Web look around and to help all on YouTube as I rarely get into someone Also try to find a video I read stuff, so the video seems more productive to me. What would I want my URL to read something ...

... co.uk/sport/football/this-is-the-title .. and if This was another topic ... ... co.uk/sport/tennis/this-is-another-title ... something nice and clean and tells people what they see Are on Also, when I have to put it on your pages, pages do not have them there on the extension so you do not have to put .php or .html to do this so much But end of address as well ...

You should also place the id in the URL like That the structure of the UK Structurflflo is here. So instead: / game / football / this-is-title is like this:

  / sports / football / 23 / this-is-so-  

Once it is fixed, now consider installing the mod_rewrite code to get it.

Mod_rewrite and .htaccess Enable httpd.conf and then under put this code in your .htaccess DOCUMENT_ROOT directory :

  option + RewriteBase RewriteEngine on FollowSymLinks -MultiViews # turn mod_rewrite / RewriteCond% {REQUEST_FILENAME}! -d RewriteCond% {REQUEST_FILENAME}! -f RewriteCond% {REQUEST_FILENAME}! -l RewriteRule ^ play / ([^ /] +) / ([^ /] +) / ([^ /] +) /? $ /article.php?sport=$1&id=$2&title=$3 [L, QSA]    

No comments:

Post a Comment