Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
.php to .html htaccess converted > Subdomain issue
Old 03-24-2005, 04:29 PM .php to .html htaccess converted > Subdomain issue
Intensity's Avatar
Novice Talker

Posts: 8
Location: Tampa Florida
Trades: 0
I have it set up where all my .html files are able to receive the network ads.

Has anyone here that uses subdomains have any redirecting problems after installing the script? I came to find out, by messing around with the htaccess file that the rewrite rule hampers with the subdomain redirect. As soon as I remove it my subdomains work fine.

Example: Here is my URL address http://resources.MyDomain.com/ which shows up without the htaccess code.

As soon as I add the code and remove my 404 error code the same URL does not show up. Any suggestions?

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} ^(.*)\.htm [NC,OR]
RewriteCond %{REQUEST_FILENAME} ^(.*)\.html [NC]
RewriteRule ^(.*) /phptohtml.php?file=$1
</IfModule>

I can still pull the same files up under www.domain.com/folder however I still want to keep it at a subdomain level.

What can I do. Add another RewriteCondition? Novice, by the way
__________________

Please login or register to view this content. Registration is FREE

Last edited by Intensity; 03-24-2005 at 05:50 PM..
Intensity is offline
Reply With Quote
View Public Profile Visit Intensity's homepage!
 
 
Register now for full access!
Old 03-24-2005, 05:10 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
While I'm not sure exactly how to solve your problem because I have never seen that method for parsing html files as php but here is how I would do what you have above, perhaps it might give you some ideas...

Code:
AddType application/x-httpd-php .htm .html
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 03-25-2005, 11:42 AM
Intensity's Avatar
Novice Talker

Posts: 8
Location: Tampa Florida
Trades: 0
Thanks, I did try that with no resolve. It seems like the rewrite condition is only applying towards file extension listed. I guess with a subdomain name it would not have one since it would be www.domain.com/folder which reverts to www.folder.domain.com. I attempted to add "index.html" to the link but I guess subdomain redirects from folder are a little different. What I am attempting to do is avoid having to convert all my html files to php which can be a dauting task.

Anyone have any knowledge of how subdomain are redirected?
__________________

Please login or register to view this content. Registration is FREE
Intensity is offline
Reply With Quote
View Public Profile Visit Intensity's homepage!
 
Old 03-25-2005, 12:07 PM
simptech's Avatar
Skilled Talker

Posts: 81
Location: Cape Coral, Florida, United States
Trades: 0
This is just a quickie from the dark regions of my brain. Probably incorrect syntax but may give you the right idea.

RewriteEngine On
RewriteRule ^(.*)\.(htm|html)(.*)$ /$1\.php$2

The extra (.*) after the extension is to catch query strings
__________________

Please login or register to view this content. Registration is FREE

FREE PHP scripts for your website!

Last edited by simptech; 03-25-2005 at 12:09 PM..
simptech is offline
Reply With Quote
View Public Profile
 
Old 03-25-2005, 03:02 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
If you have shell access to your server changing all the filenames to end with php is not that hard.

try something like this from the command line.

Code:
ls *.htm | sed -e 's/\(.*\)\.htm$/mv \1.htm \1.php/' | sh
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 03-28-2005, 11:56 AM
simptech's Avatar
Skilled Talker

Posts: 81
Location: Cape Coral, Florida, United States
Trades: 0
Depending on how many pages exist, changing link code that points to all of these pages would be quite cumbersome don't you think?

Granted you could probably create an regular expression to sift through each file, but get one thing wrong in your RE and you're in a world of hurt
__________________

Please login or register to view this content. Registration is FREE

FREE PHP scripts for your website!
simptech is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to .php to .html htaccess converted > Subdomain issue
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23598 seconds with 12 queries