Can't locate .htaccess


#1

Hi.

I’m a complete noob at most of this stuff, and I just moved to DreamHost.

I’ve got a php framework installed (Concrete5), and I would like to enable the following code for mod_rewrite to work. Guidance says to place the following into my server configurations file or .htaccess file :

RewriteEngine On
RewriteBase /concrete/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L]

Problem is I don’t see a .htaccess file anywhere in my root or domain directories. I tried creating uploading a text file with .htaccess as the filename, but I could no longer access my site from the root directory, so I deleted the file.

Anyone out there have any advice?

Thanks!


#2

The purpose of the RewriteBase directive is to indicate what url-path needs to be added back when the rewrite is done. So the directives you posted assume the .htaccess file is in /home/username/domain/concrete/ directory where apparenty you installed the framework?

Second if you are uploading the file you may have a format problem if you are uploading it as binary instead of text. If you are familiar with logging in to a shell and using CLI you can run the dos2unix program to modify the file. Or when uploading have your FTP force text/ascii mode.

Also, here’s a tip. When something “doesn’t work” when you tell somebody else you need help you will want to mention what happens instead of what you expected. Most of the time if the web server software (DreamHost uses Apache for shared hosting) “doesn’t work” it will show an “internal server error” page but it will put details in a log file. So when that happens you want to check the log file at /home/username/logs/domain/http/error.log and then report what it says.

Customer since 2000 :cool: openvein.org


#3

Thank you, Atropos.

“The purpose of the RewriteBase directive is to indicate what url-path needs to be added back when the rewrite is done. So the directives you posted assume the .htaccess file is in /home/username/domain/concrete/ directory where apparenty you installed the framework?”

This is correct. After everything is working (I am close) I will move the framework to the domain root, and edit the rewrite stuff accordingly.

If I understand the rest of your response correctly, I need to put that code into a file called .htaccess and upload it to the /concrete directory, making sure that it gets uploaded as a text file. Then if I have a problem to check the log file and report. I will try that and repost.

Thank you,
-Robert


#4

I maanged to install Concrete5 myself but using shell access OK.

However I did have problems trying to get it to run in the web directory root after having installed it to /concrete instead. Apparently its not as simple as updating the rewrite rules.

Customer since 2000 :cool: openvein.org


#5

I’m noticing that myself…

But were you able to get the “friendly URLs” (mod_rewrite) to work?


#6

Yes.

Customer since 2000 :cool: openvein.org


#7

Sorry, but I still can’t get mine to work…

I’ve got the site running on concrete now. It’s here: tribalmiamiartshow (dot) com.

My new .htaccess consists of the following:

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L]

What are you doing that I’m not? I’ve got pages at /location, /exhibitors, /press, but none of them show up…

Thanks for your help.


#8

You mean you get a "No input file specified. " error message instead. That comes from PHP when it doesn’t know what script to run.

When setting up a domain, you have two options for how DreamHost will run PHP for you. There is ‘PHP 5 CGI’ and ‘PHP 5 FastCGI’. There are additional steps to run PHP 5 FastCGI though and if you don’t take them you get that error.

So either switch the domain to run ‘PHP 5 CGI’ or follow http://wiki.dreamhost.com/PHP_FastCGI (you don’t need a custom PHP.INI file, just the right directives and the disaptcher)

Customer since 2000 :cool: openvein.org