Pretty Urls Issue

When I set up pretty urls, it does show pretty urls; the blog page shows up normal; however, the post page content changes and doesn’t load stacks, etc., which doesn’t look pretty.
I’ve republished all files each time i make a change however cannot find the problem. Any ideas?

Hi @Imperial – Not sure what you mean by “post page content” since you said the blog page is showing as expected. Are you referring to the Editor page? If so the tutorial video for Pretty URLs does not instruct you to enabled Pretty URLs on the Editor page. Go back and watch through that video to make sure you’re setting up your Alloy install correctly for Pretty URLs.

Ive checked and im definitely setting up pretty urls as the video instructs.
Without pretty urls the blog page and individual blog post shows perfect.
With pretty urls the pretty url works as it should, the blog page shows correctly, the individual blog post doesnt load stacks or image etc.

Provide us a copy of your project file please, a folder containing your posts folder from your server and a with a link to the live site.

Create a ZIP file containing your project file. This is the file you open in RapidWeaver to edit your site. Also include the posts folder. After creating the ZIP file, upload it using a service like Dropbox, WeTransfer, Droplr, or a similar service to create download link for us. Paste that download link in your reply.

If you can please also provide a copy of the text you have in your htaccess file.

Also check to make sure you only have an index.php file in your blog folder. If you also have an index.html file delete it.

RewriteEngine On
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

RewriteRule ^index.html$ / [R=301,L]
RewriteRule ^(.*)/index.html$ /$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

# Remove "index.html" from all URLs
RewriteRule ^(|.+/)index\.html$ /$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule blog/(.*) blog/?id=$1 [L,NC,QSA]

ErrorDocument 404 https://needcarkeys.com.au/404/

RedirectMatch 301 /Automotive_Car_Locksmith_Brisbane.html    https://needcarkeys.com.au/car-keys-brisbane/
RedirectMatch 301 /Automotive_Car_Locksmith_Gold_Coast.html    https://needcarkeys.com.au/
RedirectMatch 301 /Automotive_Car_Locksmith_Tweed_Coast_Northern_Rivers.html    https://needcarkeys.com.au/car-keys-tweed-coast/

https://drive.google.com/file/d/1d6OCG9AJi4AwEgpx7X8Oj9D4rzO08ZhV/view?usp=sharing

I don’t believe this is an Alloy error but instead your htaccess setup. You have a lot of custom rewrites going on in that htaccess file, and I suspect that they’re colliding with one another. While I have some experience in htaccess files it is not my primary focus, nor my forte.

My suggestion would be to try the following (below), but I can’t advise you on what you need to keep from your previous htaccess file or why you have some of these rewrites in there as I don’t know your situation or what you were trying to accomplish.

Make a backup of your current htaccess file and then try replacing it with the following:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule blog/(.*) blog/?id=$1 [L,NC,QSA]

ErrorDocument 404 https://needcarkeys.com.au/404/

RedirectMatch 301 /Automotive_Car_Locksmith_Brisbane.html    https://needcarkeys.com.au/car-keys-brisbane/
RedirectMatch 301 /Automotive_Car_Locksmith_Gold_Coast.html    https://needcarkeys.com.au/
RedirectMatch 301 /Automotive_Car_Locksmith_Tweed_Coast_Northern_Rivers.html    https://needcarkeys.com.au/car-keys-tweed-coast/

Let me know how that goes. Also as I said, make sure you don’t have an errant index.html file in that blog folder on your server. If this doesn’t fix the problem I can publish your project here on my server tomorrow when I’m back in the office at my desk. :+1:

1 Like

Also as an aside, I think you likely have other files besides blog posts in your posts folder. That is why these errant “empty” looking posts are appearing:

And finally – I went to download your project file, here (https://drive.google.com/file/d/1d6OCG9AJi4AwEgpx7X8Oj9D4rzO08ZhV/view?usp=sharing) but it was not the project file.

As I mentioned in my original request:

Thankyou, seems the http redirect conflicts with the blog redirect for some reason.
rewritten and it works now.

I’m not sure what the errant “empty” posts are? Only files in the posts folder are the index.php file and 1 .md file. So not sure how to fix that?

Cheers mate

There should be no php file in the posts folder. This indicates to me that something is misconfigured in your Alloy setup or your site’s folder naming for your pages.

All fixed now, conflicting folder names.

Thanks for your time.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.