Forum Moderators: phranque
Got a problem that needs some advice. I have a number of files where both the target file name and path are going to be changed.
There are two types of file names in the directory before the change:
*1 /main/includes/ski/france_place_name.shtml [- with underscore.]
*2 /main/includes/ski/france_placename.shtml [- without underscore.]
And heres the **ideal** URI structure after the change:
/main/show/ski/index.shtml?resort=placename [- no trace of a underscore >:->.]
Hopefully you can see the problem.
So far I have had no problem in redirecting either one or the other file name types at any one time but not a handle for both, not very nicely anyway. Even when I used '¦' pipe delimiter to define the two types it seems hard to me, at this late hour, on how to actually get rid of the underscore in the first file type e.g. pleace_name.shtml.
I should proberly give myself a slap and get book swating on RegEx again but in the meantime can anyone offer some advice on this problem.
Many Thanks, mat
RewriteRule ^main/includes/ski/france_([^_]+)_?([^_]*)\.shtml /main/show/ski/index.html?resort=$1$2
;)
RewriteRule ^[a-z]+_([a-z]+)\.shtml$http://www.website.co.uk/main/show/ski/index.shtml?resort=$1[R=301,L]
RewriteRule ^[a-z]+_([a-z]+)_([a-z]+)\.shtml$ [website.co.uk...]
RewriteRule ^[a-z]+_([a-z]+)_([a-z]+)_([a-z]+)\.shtml$ [website.co.uk...]
RewriteRule ^[a-z]+_([a-z]+)_([a-z]+)_([a-z]+)_([a-z]+)\.shtml$ [website.co.uk...]
RewriteRule ^[a-z]+_([a-z]+)_([a-z]+)_([a-z]+)_([a-z]+)_([a-z]+)\.shtml$ [website.co.uk...]
cheers, mat
Why do you want those dynamic URLs to show in the user's address bar and in search engine listings? This "cancels" the value of converting your links to static-looking URLs.
Changing your first rule as an example of how to do this with a "silent" internal rewrite, we get:
RewriteRule ^[a-z]+_([a-z]+)\.shtml$ /main/show/ski/index.shtml?resort=$1 [L]
Jim
> A question...
A good question.
I suppose its habbit, I coded the RewriteRule to clear up on a recent change I made to a site. This rule can only be live for a month and then I have to remove it. I wanted the user and Search Engine to get a jump on the fact that requests to the first page has since been moved and has been moved permanently.
Cheers for the shout on the spaces as well I always forgetting about that... getting a bit too tab happy :)
Cheers, mat