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

Posts: 8
Location: Tampa Florida
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
__________________
Tampa web designers

Last edited by Intensity : 03-24-2005 at 04:50 PM.
Intensity is offline
Reply With Quote
View Public Profile Visit Intensity's homepage!
 
When You Register, These Ads Go Away!
Old 03-24-2005, 04:10 PM
Republikin's Avatar
Super Moderator

Posts: 3,191
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
Republikin is offline
Reply With Quote
View Public Profile
 
Old 03-25-2005, 10:42 AM
Intensity's Avatar
Novice Talker

Posts: 8
Location: Tampa Florida
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?
__________________
Tampa web designers
Intensity is offline
Reply With Quote
View Public Profile Visit Intensity's homepage!
 
Old 03-25-2005, 11:07 AM
simptech's Avatar
Skilled Talker

Posts: 81
Location: Cape Coral, Florida, United States
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
__________________
PHPScripts4Free.com
FREE PHP scripts for your website!

Last edited by simptech : 03-25-2005 at 11:09 AM.
simptech is offline
Reply With Quote
View Public Profile Visit simptech's homepage!
 
Old 03-25-2005, 02:02 PM
Republikin's Avatar
Super Moderator

Posts: 3,191
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
Republikin is offline
Reply With Quote
View Public Profile
 
Old 03-28-2005, 10:56 AM
simptech's Avatar
Skilled Talker

Posts: 81
Location: Cape Coral, Florida, United States
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
__________________
PHPScripts4Free.com
FREE PHP scripts for your website!
simptech is offline
Reply With Quote
View Public Profile Visit simptech's homepage!
 
Reply     « Reply to .php to .html htaccess converted > Subdomain issue
 

Thread Tools

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

vB 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.15449 seconds with 12 queries