Grow your CSS skills. Land your dream job.

.htacces not working

  • # February 10, 2013 at 3:13 am

    I have this .htaccess code:


    RewriteEngine On
    RewriteRule /stuff/confadarte-bikini-styles/post/(.+) /stuff/confadarte-bikini-styles/func/post.php?slug=$1
    RewriteRule /stuff/confadarte-bikini-styles/category/(.+) /stuff/confadarte-bikini-styles/func/category.php?slug=$1


    RewriteRule ^index.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /stuff/confadarte-bikini-styles/index.php [L]

    But it half works. so this is what works:

    When you go to “post/**_the_slug_**” it works.
    When you go to “**_the_page_name_**/” it works.

    But what does not work is when you go to “category/**_the_slug_**” it does the second thing that works and gives a 404 error becase index.php cant find “pages/category.php”

    Can you please tell me what is going on.

    # February 10, 2013 at 4:47 am

    RewriteEngine On

    RewriteBase /

    RewriteRule ^stuff/confadarte-bikini-styles/post/(.+)$ stuff/confadarte-bikini-styles/func/post.php?slug=$1
    RewriteRule ^stuff/confadarte-bikini-styles/category/(.+)$ stuff/confadarte-bikini-styles/func/category.php?slug=$1

    RewriteRule ^index.php$ – [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . stuff/confadarte-bikini-styles/index.php [L]

    The above works fine for me. I created a very reduced test case (designed to work from a domain subfolder called htmlmaniac):

    [http://walkerbox.co.uk/htmlmaniac.zip](http://walkerbox.co.uk/htmlmaniac.zip “Reduced test case zip file”)

    # February 10, 2013 at 5:03 am

    Sorry i just sorted it after i made this discussion.

    Anyway i tired it and it didn’t work.

    The real thing is at http://html-mania.co.uk/stuff/confadarte-bikini-styles/

    You need to have the username and password to get to it.

    Username: Benjamin
    Password: htmlmania

    # February 10, 2013 at 5:17 am

    Sorry, the above post isn’t particularly clear. You say you sorted it, but tried it and it didn’t work? Was it my code that didn’t work? If so, then that is unusual and might be worth taking time to fix, especially since it works fine on my own server. If you found your own fix, what did you need to change?

    The link you posted doesn’t show me anything that would help me resolve your issue. If you want me to take a look, feel free to zip up your code and link to it. I have some free time today and am happy to help.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".