Changing URL's to look like index.php/argument1/argument2/et

 
Post new topic   Reply to topic    Aprelium Forum Index -> URL Rewriting
View previous topic :: View next topic  
Author Message
Caldus
-


Joined: 14 May 2003
Posts: 4

PostPosted: Sat Feb 03, 2007 10:10 pm    Post subject: Changing URL's to look like index.php/argument1/argument2/et Reply with quote

I am using a PHP MVC framework and it recommends using URL's of this style for your PHP configuration:

http://www.whatever.com/some_applica...ent2/argument3...

instead of:

http://www.whatever.com/some_applica...2&id=argument3...

Thanks!
Back to top View user's profile Send private message
Tom Chapman
-


Joined: 09 Jul 2005
Posts: 933
Location: Australia

PostPosted: Sun Feb 04, 2007 12:16 am    Post subject: Reply with quote

Mmk.. Thats lovely...
Back to top View user's profile Send private message Visit poster's website MSN Messenger
Caldus
-


Joined: 14 May 2003
Posts: 4

PostPosted: Sun Feb 04, 2007 12:32 am    Post subject: Reply with quote

Umm ... OK?

I was asking a question ... how do I go about changing the URLs to look like that for my web server?
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sun Feb 04, 2007 10:20 am    Post subject: Re: Changing URL's to look like index.php/argument1/argument Reply with quote

Caldus,

We suggest reading http://www.aprelium.com/abyssws/articles/urlrewriting-tutorial.html .
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Sun Feb 04, 2007 5:56 pm    Post subject: Reply with quote

Caldus wrote:
Umm ... OK?

I was asking a question ... how do I go about changing the URLs to look like that for my web server?


Actually, there isn't a single question mark in your first post, making it a statement rather than a question.

I'm not an expert on regular expressions, however I think redirecting /application/(.*)/(.*) to /application/index.php?$1&$2 should solve your problem.
Back to top View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Mon Feb 05, 2007 11:29 pm    Post subject: Reply with quote

For more info about regex and rewriting, check out the documentation --> http://localhost:9999/doc/hosts-configuration.html#HOSTS-URLREWRITE

A word to the wise: you should begin the regular expression match with a caret. ^/index.php/(.*)/(.*)/(.*)
The caret is another way of saying "begins with". Just the regex /index.php/(.*)/(.*) will match with /some_dir/sub_dir/index.php/243/ad

Another word of advice: If are three slashes in the URL regex, you will need to have three parameters in the user's request URL. Otherwise, it won't match. But if you just have ^/index.php/(.*) you could run into trouble. Know how many parameters the user's request URL will have.
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
Jokerham
-


Joined: 24 May 2016
Posts: 3

PostPosted: Tue Jun 21, 2016 5:15 am    Post subject: Reply with quote

Is there a way to allow multiple parameters, instead of making a redirection for all the parameter counts possible?

I mean can we have following conditions

^/index.php/(.*)
^/index.php/(.*)/(.*)
^/index.php/(.*)/(.*)/(.*)
^/index.php/(.*)/(.*)/(.*)/(.*)
^/index.php/(.*)/(.*)/(.*)/(.*)/(.*)
... and so forth ...

into a single condition?
Back to top View user's profile Send private message
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1295

PostPosted: Fri Oct 07, 2016 12:46 pm    Post subject: Reply with quote

Jokerham wrote:
Is there a way to allow multiple parameters, instead of making a redirection for all the parameter counts possible?

I mean can we have following conditions

^/index.php/(.*)
^/index.php/(.*)/(.*)
^/index.php/(.*)/(.*)/(.*)
^/index.php/(.*)/(.*)/(.*)/(.*)
^/index.php/(.*)/(.*)/(.*)/(.*)/(.*)
... and so forth ...

into a single condition?


What would be the redirection target for all these rules? Can you provide some examples (original URL=> rewritten URL)?
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> URL Rewriting All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group