Reputation: 689
How do I make htaccess include the post name when rewriting the url? Currently I am using a code-canyon purchased platform which does not come with SEO Friendly urls how ever the product is amazing otherwise.
Here is the code before any htaccess changes.
<a href="'.$this->url.'/index.php?a=track&id='.$row['id'].'" id="song-url'.$row['id'].'" target="_blank">'.$this->title.'</a>
I am looking to get my tracks page "Which is the content page in this example" to display in the url something like http://www.example.com/tracks/song-name-here but instead it displays something like this http://www.example.com/index.php?a=track&id= and the ID Does not even generate the post name it's just a random number.
Here is my current rewrite rules for the url http://www.example.com/index.php?a=track&id=
RewriteRule ^([^/]*)/([^/]*)\.html$ /index.php?a=$1&id=$2 [L]
You can check out the product in which I have purchased over at http://codecanyon.net/item/phpsound-music-sharing-platform/9016117 if you would like more information to help me out.
Upvotes: 0
Views: 249
Reputation: 108
You cannot do this without adding this functionality to the PHP code you are using. I clicked the "support" tab on the codecanyon.net page and the author clearly states in the FAQ:
URL’s rewrite Due to multiple server environment which requires different rewrite url’s I decided not to include this feature at the moment (it can be easily implemented), however this feature will be taken in consideration for implementation in further updates.
You cannot do this with rewrite rules only - the software needs to maintain a own 1-1 mapping of SEO-friendly URLs to ugly URLs. Most frameworks and CMS like Wordpress, Drupal, etc, provide this as a feature. PhpSound explicitly does not offer this functionality.
Upvotes: 1