Simple RewriteRule


 
Thread Tools Search this Thread
Top Forums Web Development Simple RewriteRule
# 1  
Old 06-05-2013
Hammer & Screwdriver Simple RewriteRule

I am trying with a simple RewriteRule in apache.
Apache is installed in /var/www/folder3
I have a web-app in folder3 and has files index.php, file2.php.

My requirement is not to show original php file.

That is if index.php is accessed, it should show index.po/index.html
If file2.php is accessed, it should show file2.po/file2.html

Inside the root directory, I have .htaccess file. and its contents are
Code:
RewriteEngine On
RewriteRule     .*      index.php [L]

And in the http.conf file, I have
Code:
<Directory /var/www/file2>
Order deny,allow
RewriteEngine On
</Directory>

Please help Smilie

Last edited by Scott; 06-11-2013 at 09:27 AM.. Reason: Code tags, please...
# 2  
Old 06-05-2013
Is file2 a directory or a file name fragment?

http://www.addedbytes.com/articles/f...for-beginners/ looks good.

Last edited by DGPickett; 06-05-2013 at 04:30 PM..
# 3  
Old 06-06-2013
Wrench

What is file name fragment ? (Smilie)

file2.php is file in disk.
# 4  
Old 06-10-2013
filw2.po is a directory, then?

You need to have a rewrite rule that translates the simple URI to the other, longer URI, providing that directory.
# 5  
Old 06-11-2013
Signal

The line in the 1st post for file2.po/file2.html indicates OR

And file2.po is not a directory.
# 6  
Old 06-11-2013
Well, to the outside world the rewrite would make it seem file2.po is a directory?
Quote:
If file2.php is accessed, it should show file2.po/file2.html
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

A Simple Clock, Well Maybe Not That Simple...

The attachment says it all really... It is a DEMO at a glance digital readout using the "date" command to make it useful... For a Mocbook Pro 13", OSX 10.7.5, but may well work on Linux variants too. Enjoy... #!/bin/bash # # Clock.sh # A bash DEMO to create a 6 x 7 character set... (4 Replies)
Discussion started by: wisecracker
4 Replies

2. Red Hat

Syslog.conf: looking for a simple answer on a simple question

Cheers! In /etc/syslog.conf, if an error type is not specified, is it logged anywhere (most preferable is it logged to /var/log/messages) or not? To be more precise I am interested in error and critical level messages. At default these errors are not specified in syslog.conf, and I need to... (6 Replies)
Discussion started by: dr1zzt3r
6 Replies

3. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

4. Web Development

[SOLVED] Regex with Apache RewriteRule

Hello Folks.... How you doing all ... Need your assistance with an Regex with apache rewriterule. This is what am doing... 1. Using Apache webserver as proxy server for multiple tomcats 2. Using IP filter with in apache using RewriteCondition and RewriteRule 3. Trying to specify in... (1 Reply)
Discussion started by: Lynx4DBA
1 Replies

5. Shell Programming and Scripting

Something simple, I think...

Hello to all, I have a very simple script that Ii run to CD into a specific directory. When I run it without a dot notation or shell notation (as a subshell, therefore), the script does not actually change the directory. But how do I avoid using the dot or shell notation and still be able to... (1 Reply)
Discussion started by: confutatis
1 Replies

6. Shell Programming and Scripting

Simple to you not simple to me pattern matchin help

hey all, im new and my first question is: say i have a word "blahblah" how do i get and replace the last letter of the word with say k, so replace the h with a k. However you cant just replace the h it has to change the LAST LETTER of the word. Cheers In advance. :b: (0 Replies)
Discussion started by: aleks001
0 Replies

7. Programming

Simple C question... Hopefully it's simple

Hello. I'm a complete newbie to C programming. I have a C program that wasn't written by me where I need to write some wrappers around it to automate and make it easier for a client to use. The problem is that the program accepts standard input to control the program... I'm hoping to find a simple... (6 Replies)
Discussion started by: Xeed
6 Replies

8. UNIX for Advanced & Expert Users

simple one

echo echo ((zz=$ee+$ff+$aa)) echo $zz <==Problem==> ee= 12.5 ff = 20.6 aa = 10.5 The ouput of zz should be 43.6 BUT i am getting 42. So it means anything after the comma is not counted. Please help. (2 Replies)
Discussion started by: kekanap
2 Replies

9. UNIX for Dummies Questions & Answers

Ok simple question for simple knowledge...

Ok what is BSD exactly? I know its a type of open source but what is it exactly? (1 Reply)
Discussion started by: Corrail
1 Replies
Login or Register to Ask a Question