• Resolved aminabbasian

    (@aminabbasian)


    Hey Guys,

    Need some help please.

    I have recently used WordPress to create a new site for a client. The client has his own gallery which they want to use which has it’s own rewrite via the .htaccess file. This works fine with no problems.

    However when I use the permalinks within wordpress to customise the URL’s of the posts and pages i have some problems.

    The permalinks I am using is https://www.domain.com/%postname%/ so https://www.domain.com/?page_id=4 for example should become https://www.domain.com/contact

    While an example of the URL for the gallery will be:

    https://www.domain.com/dates/city/76/1186/venue.htm these URLs are not found and I get a 404 Error when the permalinks is being used

    Any ideas how I can fix this issue?!…

    The full .htaccess rewrite is:

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

    RewriteEngine on

    # rules for gallery which works fine
    RewriteRule ^locations/([A-Za-z]+)\.htm$ /photos.php?l=$1
    RewriteRule ^photos/([A-Za-z]+)/([0-9]+)/([^/]+)\.htm$ /photos.php?l=$1&v=$2
    RewriteRule ^club_dates/([A-Za-z]+)/([0-9]+)/([0-9]+)/([^/]+)_page([0-9]+)\.htm$ /photos.php?l=$1&v=$2&e=$3&p=$5

    [/CODE]

    any help will be appreciated.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • offspring

    (@offspring)

    I’m not an Apache expert, but I think you have to put rules for gallery before WP rules.

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

    these lines for example say that if there is no such file or directory send it to WP index.php and stop processing any other rules.

    Thread Starter aminabbasian

    (@aminabbasian)

    thanks for the tip but unfortunately this hasn’t solved the issue.

    i still receive a 404 error with the gallery rewrite.

    Thread Starter aminabbasian

    (@aminabbasian)

    Hey guys,

    anyone with any ideas on this!!?

    thanks!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘.htaccess conflict’ is closed to new replies.