Solved

redirect url .htaccess

Posted on 2013-11-13
5
662 Views
Last Modified: 2013-11-14
Hello experts

Quick question.

I'm using piwigo as a photo gallery site.
I want the frontpage to open a photo album and not the category view of albums.
I didn't find any piwigo way of doing it (or i must have overlooked it) so i'm looking to try it with .htaccess

I want my current URL :
http://www.mysite.com/gallery/
To default to:
http://www.mysite.com/gallery/index.php?/category/2

I tried

RewriteEngine on
RewriteRule ^ index.php?/category/2 [R,L]

this puts the homefolder path in the url to making it break
it becomes http://www.mysite.com/home/domains/mysite.com/gallery/index.php?/category/2

Can anyone give me a quick shout on what the correct rewriterule is for what i'm trying to achieve ?

Greetz
0
Comment
Question by:Th0R
[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
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:Dontmilkthis
ID: 39646610
Since it appears you want to redirect it to the same location every time, can you not just put the full URL in the redirect?

RewriteEngine on
RewriteRule ^ http://www.mysite.com/gallery/index.php?/category/2 [R,L]
0
 

Author Comment

by:Th0R
ID: 39646620
Hello

When i try that it creates a loop
The_page_is_not_redirecting_properly
0
 
LVL 5

Accepted Solution

by:
Dontmilkthis earned 500 total points
ID: 39646638
I'm guessing you'll need to put a RewriteCond on it then

if you check out this link there's a couple of basic examples - http://webmaster.iu.edu/tools-and-guides/maintenance/redirect-htaccess.phtml

you'll have to adjust this as required, but my first stab would be something like

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/gallery/$
RewriteRule ^ http://www.mysite.com/gallery/index.php?/category/2 [R,L]
0
 
LVL 12

Expert Comment

by:junipllc
ID: 39647761
You can also try (syntax not double-checked):

Redirect permanent /gallery/ /gallery/index.php?/category/2

Look up the Redirect syntax, though...I'm not sure if you need the leading slashes. Not even sure it will work, but I just wanted to throw this possibility out there in case you don't want to use mod_rewrite (even though you mentioned it in your question).

Cheers,

Mike
0
 

Author Closing Comment

by:Th0R
ID: 39649068
thnx,
adding RewriteCond %{REQUEST_URI} ^/gallery/$
did the trick
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

749 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