Forum Moderators: phranque
My apologies for this simple question--I'm pretty new to web development.
I've created a new page on my site that has messy URL: [domain.com...]
I would like to rewrite this URL as either:
1) [domain.com...]
OR
2) [domain.com...]
What code should add to my .htaccess file to implement this rewrite? I can't seem to understand these apache commands for the life of me!
Thanks for your help!
Mod_rewrite cannot be used to change the URLs that your script outputs; Only the script itself can do that.
Jim
Could this developer friend perhaps assist you in modifying the script that produces the new page's 'ugly' URL? It's just a matter of matching (detecting) the case where that new URL would be produced as a link on the page, and outputting the friendly version instead. Then, as suggested, you add that mod_rewrite code to .htaccess so that when the friendly URL is requested from your server, the server will 'know where to go' to run your script again to generate the content for that page.
It's a two-part process: Modify the link on the page to make it friendly, and then tell Apache what to do when it gets a request for that friendly link.
Jim