Jump to content



Welcome to AstaHost - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!

Toggle shoutbox Shoutbox Open the Shoutbox in a popup

@  yordan : (19 June 2013 - 02:28 PM) Long Life To Asta New Era
@  agyat : (19 June 2013 - 01:58 PM) New Era Start At Asta Or Asta Start In New Era. :unsure:
@  yordan : (16 June 2013 - 05:41 PM) You're Welcome, Agyat!
@  agyat : (16 June 2013 - 07:38 AM) Thanks Yordan...
@  velma : (16 June 2013 - 12:06 AM) I Have Asked Opa To Check For A Backup.. He'll Let Me Know Soon :)
@  velma : (16 June 2013 - 12:05 AM) T_T It Seems That Someone Has Deleted That Topic Since I Found The Url Of The Topic But It Gives Me An Error
@  yordan : (15 June 2013 - 10:31 PM) @velma : It's A Tuto On How To Create A Login Program.
@  yordan : (15 June 2013 - 10:31 PM) Happy Birthday To Youuuuuu Agyat!
@  yordan : (15 June 2013 - 10:31 PM) Ba$
@  agyat : (15 June 2013 - 04:41 PM) :(
@  agyat : (15 June 2013 - 04:41 PM) Where The Hall I Were? 15Th Is Almost At End And No-One Wished Me "happy Birthday"!!!
@  velma : (14 June 2013 - 10:39 AM) Which Tutorial Is He Searching For?
@  velma : (14 June 2013 - 10:38 AM) Which Tutorial Is He Searching For?
@  yordan : (14 June 2013 - 07:47 AM) Ok, Have A Look Tomorrow.
@  yordan : (13 June 2013 - 03:19 PM) @velma, Can You Have A Look At Feelay's Problem? Seems That His Tutorial Is Not Searchable Today.
@  Feelay : (13 June 2013 - 08:11 AM) Oh, Haha
@  velma : (12 June 2013 - 05:39 PM) T_T Lately My Levels Of Procrastination..... **sigh**
@  velma : (12 June 2013 - 05:38 PM) I'll Do It Later
@  velma : (12 June 2013 - 05:38 PM) Procrastinators.. People Who Keep Saying "i'll Do This In A Bit"
@  Feelay : (12 June 2013 - 02:05 PM) Deal Punishments To What?

Replying to Htaccess Reditrect Help


Post Options

    • Can't make it out? Click here to generate a new image

  or Cancel


Topic Summary

yordan

Posted 02 September 2009 - 05:40 PM

If you are on a Linux system, you can do a little bit scripting in order to do the job.
Once you have the names of the files you renamed (for instance names.html should become names.php)
You can obtain the list of the concerned files with something like "grep names.php *"
And then, for each of the concerned files, do
cat $1 |sed 's /names.html/names.php/g'|sed 's/file2.html/file2.php' >$1.tmp; cp $1.tmp $1
Of course, backup your source folder, and first test it without the last "cp" instruction...

wutske

Posted 02 September 2009 - 12:37 PM

Imho that's not a good way, either link to the correct files or don't link to them at all.

dazedandconfused

Posted 02 September 2009 - 06:59 AM

Hey guys-

New to the forum and have a question you'll probably think is really easy with htaccess.

I've recently completed 1 phase of a redesign of a website and have changed files in a directory from html to php. I know I can use the 302 redirect for making the permanennt change, but I was trying to avoid targeting each file and would rather target the complete directory.

Here's an example of what I need to do:

http://mydomain.com/main/*anyfile.html redirects to http://mydomain.com/main/*anyfile.php

Any help would be greatly appreciated!

Thanks!

Review the complete topic (launches new window)