简体   繁体   中英

Htaccess conflict SEO Url friendly

The code below seems to conflict with index.php

How Would i go about allowing index.php? :) > http://www.domain.com/

Options -MultiViews
RewriteEngine on
RewriteBase /

RewriteRule ^(\w+)/?$ live.php?content=$1 [L,QSA,NC]

note: i still want it to rewrite the url to /$1

all help is grateful i will obviously thank the solution.

if you have a solution for this without affecting the current structure feel free to post below.

Better to add a RewriteCond to avoid rewriting for existing files/directories:

DirectoryIndex index.php
Options -MultiViews
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(\w+)/?$ live.php?content=$1 [L,QSA]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM