Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite not working

         

dedoo

1:10 pm on Nov 10, 2006 (gmt 0)

10+ Year Member



Hi all,

I just changed hosts from a shared server to a VSP and I am having problems with configuring the mod_rewrite module I think ...

I am no expert when it comes to Unix at all but I did manage to set up a few virtual hosts for the sites I own.

I moved the sites I own to the new virtual hosts and I am working on the first
Joomla (the CMS is Use) works...well It loads the frontpage and OpenSEF seems to work to as the dynamic urls are changed to the SEF url's I defined.

BUT the pages are not loading I just receive a regular 404 message not even the 404 page I defined in the sef module.

The same actually goes for wordpress it opens the frontpage but the searchengine friendly urls do not open the actual pages

in the httpd.conf file I added this for the new virtual host


<VirtualHost *:80>
DocumentRoot /home/username/html
ServerName [url]www.mydomainname.com[/url]
<Directory "/home/username/html">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ServerAdmin [email]webmaster@mydomainname.com[/email]
ServerAlias *.mydomainname.com
Options Indexes
</VirtualHost>

where username and mydomainname are off course set to their proper names

the following is my .htaccess file that works on the shared host


<Limit GET POST>
order allow,deny
allow from all
deny from 206.145.80.235
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
# BEGIN mambo
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule . /index.php [L]
</IfModule>
# END mambo
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomainame.com
RewriteRule (.*) [mydomainame.com...] [R=301]

I really have no clue what be going wrong
any help is very much appreciated

!

Thanks
Danny

PS I did not change the DNS yet so the pages are loaded from
[IPnumber~username...]

Would it make a difference if the DNS was changed from where my pages are still hosted on my shared server to the new?

cabowabo

2:23 pm on Nov 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not an expert at this, but I know my way around the block. I encountered a similar problem when I changed hosts - and looking at the rewrite conditions, they look good to me. The problem that I had was that the host I went to didn't have mod_rewrite turned on as a default. I'd check that first. :-) I hung my head low for awhile when I found out after pulling my hair out for two days.

Cabo

dedoo

3:00 pm on Nov 10, 2006 (gmt 0)

10+ Year Member



I was doing the same thing
But I found the problem

as I wanted to get my site to work smoothly before changing the dns I forgot one tiny thing

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule . /index.php [L]
</IfModule>

I had this in my htaccess but it should have been this

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~username/
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule . /~username/index.php [L]
</IfModule>

It works like a charm now
I was all the time looking at the wrong files ... I think I opened the httpd.conf file more than 100 times...

dedoo

3:03 pm on Nov 10, 2006 (gmt 0)

10+ Year Member



If had just changed my dns it would have worked right away lol
turns out my caution caused me problems ....

cabowabo

3:53 pm on Nov 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Glad it is working out. Don't you hate that ... always something stupid and simple.

But that's what makes this business great.

Cabo