Jump to content

URL rewriting in my custom module


Genie

Recommended Posts

I am developting a custom module amd want to display a page of my module in fromtend. So i have created a file display.php and assigned the smarty variables with to a tpl file called display.tpl file. Now it is showing the view when the address bar url is http://localhost/modules/mymodule/display.php. But i want to rewrite the url suppose as http://localhost/modules/mymodule/display/ Which will show the same view as it is showing with http://localhost/modules/mymodule/display.php. Need help. Please tell me how to do this with .htaccess file or something else and how.

Link to comment
Share on other sites

Hello El Patron

I tried this what you told. But I can't find my-module's display page in the drop down list to be selected. another question is I don't want to do this with backend. I just want whenever my module is installed it will come with that url re-written feature. Is this possible?

Link to comment
Share on other sites

I think you might look at existing module (see the drop down in seo & urls) to see how those modules register their page name.  Then I think it might be possible to add (using module) the module page to the existing pages like AdminMeta&addmeta.

Link to comment
Share on other sites

Hello El Patron

I tried this what you told. But I can't find my-module's display page in the drop down list to be selected. another question is I don't want to do this with backend. I just want whenever my module is installed it will come with that url re-written feature. Is this possible?

 

did you tried something like this?

$urlLink = new Link;
        
$myCleanUrl = $urlLink->getModuleLink('modulename', 'prettylink');
Edited by misthero (see edit history)
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...