iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-10-2007, 07:56 AM
WebProWorld Member
 
Join Date: May 2007
Location: Grimsargh, UK
Posts: 39
apwade RepRank 0
Default .htaccess commands

Does anybody have a list of the .htaccess commands with brief explantation or know where i can find such a list?

Also does anybody know how to redirect a directory of files to one file?

i.e. /shops/shop1.htm redirects generic.htm
/shops/shop2.htm redirects generic.htm
/shops/shop3.htm redirects generic.htm etc

and keeps the old url address

Cheers Andrew
__________________
Discount shopping vouchers
Reply With Quote
  #2 (permalink)  
Old 08-10-2007, 10:26 AM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,648
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: .htaccess commands

The best resource for server directives would be at Apache HTTP Server Version 2.2 Documentation - Apache HTTP Server

To redirect an entire directory, you would use
Code:
RedirectMatch 301 ^/shops/.*$ http://yourserver/generic.htm
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #3 (permalink)  
Old 08-10-2007, 12:39 PM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,679
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: .htaccess commands

Is there a command that allow files parsed py PHP to be written to disk on a shared server?

I have to do all my configuration in .htaccess, since I think my hoster for security reason do not allow me access to php.ini on a shared server.

Here is a typical example august 10 2007:

http://www.kjellbleivik.com/SpHelp/morgy1

PHP Code:
print 'PHP Version on this web server is: ' PHP_VERSION '<br /> <br />'
//Parsing starts here 
$tagsXML "<root><node1>This is parsed in the same way on the latest versions of FireFox, IE and Opera</node1></root>"
$sxe = new SimpleXMLElement($tagsXML); 
print 
$sxe->asXML(); 
print 
'<br /> <br />'
print 
'You need permission to save a file to the disk'
print 
'<br />'
$sxe->asXML('morgy.xml');  //No permission to save to file 
?> 
asXML is the cause.
Reply With Quote
  #4 (permalink)  
Old 08-10-2007, 01:06 PM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,648
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: .htaccess commands

This is not an .htaccess or PHP.ini issue, this is an issue with the file system that you are using. If you have FTP access to the folder where you are trying to write the file, which should only contain files and not executable code, you would want to change the permissions of that folder to world writable.

You can test if the directory can be written to by using the following:
PHP Code:
if (is_writable('directory/')) {
   
$sxe->asXML('directory/morgy.xml') or die('can\'t write the file');
} else {
   echo 
'Permissions insufficient to write here.';

And of course at the end of the script you would have
PHP Code:
function die($msg) { echo ($msg); exit();} 
Assuming you are using a Linux server, you should chmod the folder you are writing to to 774 provided the folder only contains text files.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #5 (permalink)  
Old 08-10-2007, 03:23 PM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,679
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: .htaccess commands

Ok, I take the chance that this is correct and again contribute positively to your RepRank, even if we are competitors

If it is not, I will decrease it later on
Reply With Quote
  #6 (permalink)  
Old 08-10-2007, 03:27 PM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,679
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: .htaccess commands

I could not increase your reprank, since I have only given 4 contributions before aomong them as you know you are one of them.

Hopefulle good advice as usual and may have saved me some hours work.

I can not spread RepRank in east and west. Have to spread RR more to contribute to yours Funny ranking system
Reply With Quote
  #7 (permalink)  
Old 08-15-2007, 03:45 PM
TrafficProducer's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: United Kingdom
Posts: 1,642
TrafficProducer RepRank 3TrafficProducer RepRank 3TrafficProducer RepRank 3
Default Re: .htaccess commands

Here's some other links that may help you out:-

htaccess Files How to .htaccess

Last edited by TrafficProducer; 08-15-2007 at 03:51 PM.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
.htaccess issues Sub Rosa IT Discussion Forum 1 07-06-2007 07:28 PM
.htaccess hell dak888 Web Programming Discussion Forum 5 03-26-2007 05:30 PM
What is .htaccess and how does it work? complete Web Programming Discussion Forum 1 01-02-2006 07:40 AM
how to make use of .htaccess Miki Search Engine Optimization Forum 8 06-11-2005 10:53 AM
.htaccess question jestep Web Programming Discussion Forum 2 06-09-2005 01:07 PM


All times are GMT -4. The time now is 10:00 AM.



Search Engine Optimization by vBSEO 3.3.0