Solved

Working with .htaccess files - Display Friendly URL

Posted on 2008-06-12
4
202 Views
Last Modified: 2010-03-04
Hello,

I'm currently using WordPress as my blogging software. I've recently installed a plugin (http://me.mywebsight.ws/web/wppa) that allows me to manage multiple image galleries. By default, all galleries are displayed as so:

http://www.mysite.com/galleries/?album=89&photo=3693 

I would instead like to display the URL using the actual album and photo name:

table_photos
ID         photo                 album
3693     blue_sky           san_diego

http://www.mysite.com/galleries/san_diego/blue_sky 

I'm just wondering how hard it would be to modify the Plugin and .htaccess file to display the URL in this manner.

Thanks!

0
Comment
Question by:wattanabi2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 16

Accepted Solution

by:
Blaz earned 500 total points
ID: 21776408
I don't know about the plugin and the possibilities to change it but I can suggest an Apache only configuration change that can accomplish a similar result.

The idea is that you still keep the two ID's in the URL but also add the textual description, like:
http://www.mysite.com/galleries/89/3693/san_diego/blue_sky

or similar.

The idea is to write a rewrite rule that will convert
/galleries/<galleryID>/<photoID>/*ANYTHING*
to:
/galleries/?album=<galleryID>&photo=<photoID>


Start with the rule:
RewriteRule ^/galleries/([0-9]+)/([0-9]+)/.* /galleries/?album=$1&photo=$2

http://www.sitepoint.com/article/guide-url-rewriting

Changing to the link you posted would require changing of the plugin so that it would search by strings instead of IDs. Then you get the problems with possible duplicates - two records with the same string etc.
0
 
LVL 15

Expert Comment

by:dosth
ID: 21830653
did you get it working?
0
 

Author Comment

by:wattanabi2
ID: 21831121
Not yet. I'm currently modifying the plugin to accept strings instead of ID's.

thanks
0
 
LVL 3

Expert Comment

by:Bivek-jos
ID: 21880803
Hi wattanabi2,

I thought you want to enable Permalink in wordpress,

Sign to wordpress admin=> Click Option tab=> Click PermaLink  => and enable permalink from there

If you have any problems in wordpress contact me.or reply here

Thank You.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
In this blog, I will share you some basic tips for content marketing and to rank your website on Google.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question