main.php

mitoo

Joined: 2010-05-27
Posts: 4
Posted: Thu, 2010-05-27 04:15

Hello,

Can I change the URL structure from www.domain.com/gallery2/main.php/category TO www.domain.com/gallery2/category.

I want to remove main.php from the URL.

I have already enabled URL REWRITE in the admin settings of gallery2.3.1.

Thanks for Your Time.
Regards

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2010-05-27 04:55

You want something close, but not just /gallery2/category Trust me, it can create problems. Best to have /gallery2/v/category or something to that effect. Just a suggestion on that.

First go an uninstall URL Rewrite under Site Admin > Plugins

Then reinstall it and select Apache mod_rewrite instead of PHP Pathinfo
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
mitoo

Joined: 2010-05-27
Posts: 4
Posted: Thu, 2010-05-27 06:10

A bundle of Thanks nivekiam,

It solved the problem.

main.php is gone from the urls. but it is still there in the main url. can it be removed from there too.

www.domain.com/gallery2/main.php TO www.domain.com/gallery2

and why should removing /v/ from the urls would create problems? I have seen some demo sites of gallery2 without /v/ and /d/.

Regards
Yasir

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2010-05-27 06:25

To remove main.php from the URL, first edit config.php and near the bottom is a line for baseUri

Set the URL there to be www.domain.com/gallery2/

Then edit your .htaccess and add this:
# Set the default handler.
DirectoryIndex main.php

As for removing v/ or d/ from the URL, at the very least will break the 404 functionality and every incorrect or typo'd URL will result in gallery giving an "Item not found" message instead of dishing up a 404 message.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
mitoo

Joined: 2010-05-27
Posts: 4
Posted: Thu, 2010-05-27 09:38

Thanks for the Support nivekiam,

It solved my problem. Now the urls look clean.

Coming back to v/ or d/. If there is only one drawback of not using v/ or d/ and that is 404 issue.
Then it is okay with me.

Would you suggest using urls without v/ or d/ if i don't need 404?

Regards
Yasir

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2010-05-27 15:24

That's just one issue I could recall off the top of my head. It's not recommended to run that way, but if it seems to work for you great.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2010-05-28 00:31

FAQ: My Gallery URLs begin with /v/ and /d/, why?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2010-05-28 04:00

Ah! Perfect! I knew something explained it but couldn't remember.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here