Nips
Nips

Reputation: 13880

How to change substring in url and redirect?

I want to load my page always in that way:

http://myhost/options=mymodule

or:

http://myhost/options=mymodule?(...) something

but the system also has other modules:

http://myhost/options=othermodule

or

http://myhost/options=othermodule?(...) something

I want always redirect to my module. How to do this?

Upvotes: 0

Views: 334

Answers (2)

Nips
Nips

Reputation: 13880

The answer is:

RewriteEngine on
RewriteCond %{QUERY_STRING} !(^|&)options=mymodule(&|$)
RewriteRule ^(.*)$ index.php?options=mymodule [L]

Upvotes: 0

RageZ
RageZ

Reputation: 27323

in a htaccess file or in your apache configuration file

RewriteEngine On
RewriteRule /options=othermodule(.*) /options=mymodule$1

Upvotes: 1

Related Questions