Problems, need help? Have a tip or advice? Post it here.
13 posts Page 1 of 2
Aloha everyone,

I'm in the final stages of my site now, very excited :) I turned on pretty urls and generated a htacess file, but when after uploading the file I get 404's on every single subpage and blog posts. I can't understand what is wrong? Anyone have any clues? :roll:

Code: Select all
Options +SymLinksIfOwnerMatch -MultiViews
<IfModule mod_rewrite.c>
RewriteEngine On

#If your website is installed in a subfolder, change the line below to reflect the path to the subfolder.
#e.g. for http://www.example.com/subdomain1/subdomain2/ make it RewriteBase /subdomain1/subdomain2
RewriteBase /

#If you wish to use a custom 404 page, place a file named 404.php in your website's root and uncomment the line below.
#If your website is installed in a subfolder, change the line below to reflect the path to the subfolder.
#e.g. for http://www.example.com/subdomain1/subdomain2/ make it ErrorDocument 404 /subdomain1/subdomain2/404.php
#ErrorDocument 404 /404.php

#If your site begins with 'www', uncomment the following two lines
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]


#DO NOT EDIT BELOW THIS

RewriteRule ^index.php$ "" [R=301,L,QSA]

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule . - [L]

#video-gallery.php
RewriteRule ^video-gallery$ "$0/" [R=301,L,QSA]
RewriteRule ^video-gallery/$ video-gallery.php [L,QSA]
RewriteRule ^video-gallery/.*?([^\.\/]*)\.html$ video-gallery.php?pname=$1 [L,QSA]
RewriteRule ^video-gallery/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ video-gallery.php?d=$1$2$3 [L,QSA]
RewriteRule ^video-gallery/[^\.]*?([^/\.]*)/$ video-gallery.php?fname=$1 [L,QSA]
RewriteRule ^video-gallery/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#photo-gallery.php
RewriteRule ^photo-gallery$ "$0/" [R=301,L,QSA]
RewriteRule ^photo-gallery/$ photo-gallery.php [L,QSA]
RewriteRule ^photo-gallery/.*?([^\.\/]*)\.html$ photo-gallery.php?pname=$1 [L,QSA]
RewriteRule ^photo-gallery/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ photo-gallery.php?d=$1$2$3 [L,QSA]
RewriteRule ^photo-gallery/[^\.]*?([^/\.]*)/$ photo-gallery.php?fname=$1 [L,QSA]
RewriteRule ^photo-gallery/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#gallery.php
RewriteRule ^gallery$ "$0/" [R=301,L,QSA]
RewriteRule ^gallery/$ gallery.php [L,QSA]
RewriteRule ^gallery/.*?([^\.\/]*)\.html$ gallery.php?pname=$1 [L,QSA]
RewriteRule ^gallery/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ gallery.php?d=$1$2$3 [L,QSA]
RewriteRule ^gallery/[^\.]*?([^/\.]*)/$ gallery.php?fname=$1 [L,QSA]
RewriteRule ^gallery/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#blog_tags.php
RewriteRule ^blog_tags$ "$0/" [R=301,L,QSA]
RewriteRule ^blog_tags/$ blog_tags.php [L,QSA]
RewriteRule ^blog_tags/.*?([^\.\/]*)\.html$ blog_tags.php?pname=$1 [L,QSA]
RewriteRule ^blog_tags/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ blog_tags.php?d=$1$2$3 [L,QSA]
RewriteRule ^blog_tags/[^\.]*?([^/\.]*)/$ blog_tags.php?fname=$1 [L,QSA]
RewriteRule ^blog_tags/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#blog.php
RewriteRule ^blog$ "$0/" [R=301,L,QSA]
RewriteRule ^blog/$ blog.php [L,QSA]
RewriteRule ^blog/.*?([^\.\/]*)\.html$ blog.php?pname=$1 [L,QSA]
RewriteRule ^blog/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ blog.php?d=$1$2$3 [L,QSA]
RewriteRule ^blog/[^\.]*?([^/\.]*)/$ blog.php?fname=$1 [L,QSA]
RewriteRule ^blog/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#index.php
RewriteRule ^.*?([^\.\/]*)\.html$ ?pname=$1 [L,QSA]
RewriteRule ^([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ ?d=$1$2$3 [L,QSA]
RewriteRule ^[^\.]*?([^/\.]*)/$ ?fname=$1 [L,QSA]
RewriteRule ^\w[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
</IfModule>
Hi Tobbs,

Debugging prettyURLs issues is always a challenge :)

To begin with, please first confirm that mod_rewrite module is available on your server -
viewtopic.php?p=11832#p11832

Next make sure that you have placed the generated .htaccess file in your site's root (an not in 'couch' folder) - this happens more often than what you'd believe.

Please let me know if it helps.
Hi!

I got the same problem.

I tested, and mod_rewrite is set, as you can see on this link: http://www.sailpiraeus.com/test_rewrite/rewrite.php

But when I put .htaccess file in my site's root, I got "500 Internal Server Error".

EDIT: I need to solve this ASAP, so any help would be appreciated.
derKaiser wrote: Hi!

I got the same problem.

I tested, and mod_rewrite is set, as you can see on this link: http://www.sailpiraeus.com/test_rewrite/rewrite.php

But when I put .htaccess file in my site's root, I got "500 Internal Server Error".

EDIT: I need to solve this ASAP, so any help would be appreciated.


Please check your Apache error log for the site, it should give you a more precise line in the htaccess file that is causing the error.

Paste the error from the log here for us to be able to help more. Thanks
Image
@derKaiser, please try the solution mentioned in the following thread -
viewtopic.php?f=2&t=7388

Let us know if it helps.
KK wrote: @derKaiser, please try the solution mentioned in the following thread -
viewtopic.php?f=2&t=7388

Let us know if it helps.


@Bartonsweb helped me, and URLs are fine now.

But, there is one problem with navbar. Like some script is missing, and I changed all .js and .css to absolute.

Take a look: http://sailpiraeus.com/

When you scroll down, the navbar should get background color (#FFF), but it doesn't. Everything works fine before those changes for URLs.
Some .css files aren't even showing up even it's called in code.

Big minus for Couch from me. I will definitely reconsider to use it again in future.
Some .css files aren't even showing up even it's called in code.

Big minus for Couch from me. I will definitely reconsider to use it again in future.

Couch does not add/remove anything from your original code, I can assure you of this.
There must be some thing amiss in the code you are using.

Instead of giving up so easily upon hitting a road bump (inevitable in web development of any scale), I'd humbly request to please persist in trying to find the reason behind the problem.

We on the forum try as much we can to help with issues but will require your cooperation in that.
Let us know exactly what was expected and what is turning up. Send us the original templates.

Give up only when nothing works.
@derKaiser, responding to your PM
For example navbar:

How is now: http://xxxxx.com/

How it should be: http://xxxxx.com/xxxxx/

Try scrolling down and you will see the difference.

The 'style.css' linked to the problem site is slightly different to its equivalent on the working site. Specifically, it has the following two rules added to the very end -
Code: Select all
.navbar-header a span {
    font-weight: 100;
    font-size: 12px;
    text-transform: initial;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

Remove those or use the exact version from the other site and the problem should be solved.

In closing, as you can see poor Couch had little to do with this problem :)
Many thanks! I apologize to the Couch :D
13 posts Page 1 of 2