473,800 Members | 2,414 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.htaccess and mod_rewrite

is there a way that I can make my own file extension and have it load
as php?

from this:
example.com/something.php
to this:
example.com/something.exten sion

Oct 24 '07 #1
2 1302
On Oct 23, 11:04 pm, Lamer <Galat...@gmail .comwrote:
is there a way that I can make my own file extension and have it load
as php?

from this:
example.com/something.php
to this:
example.com/something.exten sion
You want something like this:

AddType application/x-httpd-php .foo

That will cause files with the .foo extension to be run through the
PHP engine.

Oct 24 '07 #2
Greetings, Lamer.
In reply to Your message dated Wednesday, October 24, 2007, 07:04:47,

Lis there a way that I can make my own file extension and have it load
Las php?

Lfrom this:
Lexample.com/something.php
Lto this:
Lexample.com/something.exten sion

Assume You are using PHP with Apache, take a look at Apache Filter SAPI
(php5apache2_2_ filter.dll) and Filters reference manual on Apache website.
http://httpd.apache.org/docs/2.2/filter.html
--
Sincerely Yours, AnrDaemon <an*******@free mail.ru>

Oct 24 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3687
by: Nel | last post by:
Just looking for some general advice on modifying the URL for php. I am using .htaccess to allow a web site to translate example.html to index.php?content=example (below) ErrorDocument 404 http://www.example.com RewriteEngine on RewriteRule ^/?(.*).html$ /index.php?content=$1
15
5149
by: Taki Jeden | last post by:
Hello everybody Does anybody know why w3c validator can not get pages that use 404 htaccess redirection? I set up two web sites so that clients request non-existent urls, but htaccess redirects calls to a script which parses the url and produces requested pages. It works fine with browsers, but when I try to validate the page I get a 404 error - which bewilders me, because I thought Apache does the redirection internally without sending...
2
2846
by: Geradeaus | last post by:
I use htaccess to rewrite the url using the following rules : RewriteRule ^(+)/(+)/(+)?$ index.php?lang=$1&page=$2&id=$3 The only problem I have is when http://www.domain.com/admin is given, the "admin" is used as $1. How can I define the rule for every word given except "admin" ? Thanks in advance!
2
9257
by: jaanus | last post by:
Here we go... What I have been trying to do is to forward all http requests containing /cms/ to http://cms.mydomain.com/ example1: http://host1.mydomain.com/cms/init.php would be parsed from http://cms.mydomain.com/init.php (via ajax request) example2: <script src="http://host1.mydomain.com/cms/example.js" in <html><head> would be parsed from http://cms.mydomain.com/example.js physically there are no cms directories in...
2
6005
helimeef
by: helimeef | last post by:
Hi. I'm having issues trying to get .htaccess make mod_rewrite work. I have mod_rewrite setup properly (it's in phpinfo()), but it just seems to not work. Right now I have two files, bob.html and alice.html, and of course .htaccess (all in the root directory). What I want to happen is have bob.html show up when I visit alice.html, so I put this in .htaccess: RewriteEngine on RewriteRule ^alice\.html$ bob.html .htaccess does not seem to...
9
4397
by: invertigo | last post by:
Hello, Im using this .htaccess file to rewrite my websites URL. Reason i try to do this is to make it more SEO friendly. Code: -------------------------------------------------------- Options +FollowSymLinks RewriteEngine On RewriteBase mywebsite.awardspace.com
4
6702
by: adnanjunk | last post by:
Hi, Having a little issue with .htaccess not working on windows server. I have clean url's setup using the htaccess file, working fine on linux server. I have researched for a while and found .htaccess doesn't work on windows. Since this is a shared hosting i don't have access to httpd.conf so that i can edit it. I have been reading this forum about it. http://forum.mambo-foundation.org/showthread.php?t=1857
0
2092
by: AndyPSV | last post by:
Hello, I've got .htaccess file: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) index.php It works properly on mine and others servers, but not @ DOMAIN REMOVED (company, which I get free account and register domain 4 free). I writed to them and get reply:
4
4147
Dormilich
by: Dormilich | last post by:
Hi, is there a possibility to pass variables from .htaccess to PHP? I want to tell PHP, whether mod_rewrite is enabled (so I can use modified URLs in the navigation). what I've come up so far is adding another parameter to the URL, but I'm wondering, if there's a more elegant way (I know I can change settings of the php.ini) Dormi
1
2055
by: gsherp | last post by:
I was wondering if there was anyway in the .htaccess file to access bash scripts. I want to do this because for the mod_rewrite configuration: RewriteBase /home/ { whoami } /www/ is there any equivalent way of doing a text substitution with whoami command within the RewriteBase line? Thanks, gsherp
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10275
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.