All secondary pages redirecting to WAMP Server file page WP

I’m working locally using WAMP and on one website all pages except for the home page are redirecting to the WAMP files page.

This is what the .htaccess file looks like.

The WordPress rewrite appears to the be the same as what I have on htaccess files for other websites.
What could be wrong?

# BEGIN iThemes Security - Do not modify or remove this line
# iThemes Security Config Details: 2
	<IfModule mod_rewrite.c>
		RewriteEngine On

		# Reduce Comment Spam - Security > Settings > System Tweaks > Comment Spam
		RewriteCond %{REQUEST_URI} /wp-comments-post\.php$
		RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
		RewriteCond %{HTTP_REFERER} !^https?://(([^/]+\.)?canyonvacationrentals\.com|jetpack\.wordpress\.com/jetpack-comment)(/|$) [NC]
		RewriteRule ^.* - [F]
# END iThemes Security - Do not modify or remove this line

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

<Files wp-config.php>
order Allow,Deny
Deny from all

# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
    <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary
    <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
    <IfModule mod_mime.c>
        # DEFLATE by extension
        AddOutputFilter DEFLATE js css htm html xml
# END W3TC Browser Cache

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

# END WordPress


Oh, so many things to correct here!

First, do you know whether you have mod_rewrite, mod_deflate and mod_mime enabled? If so, WHY waste server resources testing these repeatedly? Then, too, MULTIPLE tests of mod_rewrite?

As an engineer, I learned NOT to do a test if you’re not going to do anything with the results. You seem to be testing “just for fun.” Okay, I know that software developers protect themselves from complaints by using wrappers but, as a webmaster, you’re supposed to be smart enough to test once then remove that @#$%.

Second, mod_rewrite will progress through ALL its code making redirections if the conditions are met to do so. Thus, you have conflicting rules which allow redirections long before you get to the WP @#$% (I dislike their code for other reasons but you’re not there yet (their code has superfluous @#$%, too, which makes no sense to me at all - and they used to be better than that until a year or two ago).

On that note, I owe you:

  1. RewriteBase can only get you into trouble if you don’t understand that it’s redirecting to a subdirectory. IMHO, simply put your WP code in the directory where WP resides.

  2. Unless you’ve modified it, it looks like WP wised up with their index.php RewriteRule (not necessary if canyonvacationrentals’s DirectoryIndex contains index.php).

  3. /canyonvacationrentals as a redirection will first attempt to access the root OF THE SERVER before the subdirectory of the DocumentRoot. This is a potential security problem but is certainly unnecessary - especially with the RewriteBase already pointing there.

  4. Since canyonvacationrentals is a subdirectory, treat it as such and provide the trailing /.

  5. On the security issue, why would you let someone access your security area from Nice backdoor for someone to hack your website!



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