Forum Moderators: phranque
I am new to url rewriting, i need your help .
i am handling a ecommerce site,
i need to redirect this url
[mysite.com...]
to
[mysite.com...]
the img123 folder and img123.swf are parameters which is passed from a js .
how write a url rewriting for this.
i tried
RewriteRule ^flash[/](.*)[/](.*).aspx$ img/flash/$1/$2.swf
but this is not working.
please help me out.
Thanks in advance.
Which one of those very different things do you want to do?
A redirect tells the browser to go fetch a different URL, using a second HTTP request. The browser URL bar changes to show this new URL.
A rewrite silently fetches content from a different filepath within the server compared to that suggested by the path part of the requested URL.
See also many previous threads that explain why using multiple (.*) patterns can slow your server to a crawl as the pattern might have to be evaluated thousands of times before a match is found.
[mysite.com...]
to
[mysite.com...]
i need the browser show the above url instead of the orginal
Can anyone write the url writing for this
please help me out.
Thanks in advance.
What is the internal server filepath for that content? It will be just a server filepath, no domain name will be included.
Example. "I want users to use the URL example.com/cats.html to access this content, and the content will reside inside the server at the /animals.php?type=cat filepath."
Actually my real path is,
[mysite.com...]
the above one will be generated from the js function,when the user click a button
function photogallery(item)
{
var mySplitResult = item.split(".");
window.open("images/flash/"+mySplitResult[0]+"/"+item, "newWindow");
}
when the user click the button i will get the
[mysite.com...] path.
but i dont want to show the above url instead of i need to show the user to see the below url.
[mysite.com...]
Many thanks
Whatever URL you want to "show up in the user's browser address bar," that is the URL that your HTML page (or document.write JavaScript code on that page) must link to. Linking from a Web page is what defines a URL, and that URL is what shows up in the address bar when the link is clicked or activated by a JavaScript event.
That URL will then be requested from your server when the user clicks on that link or when a JS event is fired that causes an HTTP request to be sent to your server.
Once the HTTP request arrives at your server, mod_rewrite can be used to 'connect' the requested URL to the correct filepath on the server -- in this case, your actual .swf filepath.
But the link URL that you present on your Web page must be what you want to show in the browser address bar (http://www.example.com/images/flash/flash-img123.aspx) -- mod_rewrite cannot be used to change that. This URL is also the one that will appear in search engine listings, and mod_rewrite can't change that, either. Again, the link on your HTML page defines the URL.
Once this is done, then an internal rewrite from requested URL http://www.example.com/images/flash/flash-img123.aspx to server filepath /images/flash/img123/img123.swf is the last step.
Jim