2014-05-22 75 views
0

當我去whats-next/wn_controller.php?user=john.smith,它的工作原理。但是,當我去whats-next/john.smith,它不起作用。我怎樣才能讓我的htaccess文件允許一個變量的時期?

我一直在努力,這條線:

RewriteRule ^whats-next/([A-Za-z0-9-_]+)$ whats-next/wn_controller.php?user=$1 [NC,L] # Process profiles 

這樣:

RewriteRule ^whats-next/([A-Za-z0-9-\._]+)$ whats-next/wn_controller.php?user=$1 [NC,L] # Process profiles 

這:

RewriteRule ^whats-next/([A-Za-z0-9-._]+)$ whats-next/wn_controller.php?user=$1 [NC,L] # Process profiles 

但一直沒有固定它。

這裏是我的完整的.htacess文件列在下面。

# BEGIN WordPress 

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_URI} (.*)$ 

#RLA Page 
RewriteRule ^about/$ whats-next/wn_controller.php [NC,L] # Process about 
RewriteRule ^about$ whats-next/wn_controller.php [NC,L] # Process about ##WITHOUT TRAILING DASH URL TOO. FIX SOMEDAY 

#What's Next User 
RewriteRule ^whats-next/community/$ whats-next/wn_controller.php [NC,L] # Process community 
RewriteRule ^whats-next/follow-up/$ whats-next/wn_controller.php [NC,L] # Process follow-up 
RewriteRule ^whats-next/people/$ whats-next/wn_controller.php [NC,L] # Process people 
RewriteRule ^whats-next/messages/$ whats-next/wn_controller.php [NC,L] # Process messages 
RewriteRule ^whats-next/messages([A-Za-z0-9-]+)$ whats-next/wn_controller.php?message=$1 [NC,L] # Process messages 
RewriteRule ^whats-next/([A-Za-z0-9-_]+)$ whats-next/wn_controller.php?user=$1 [NC,L] # Process profiles 
RewriteRule ^whats-next/settings/$ whats-next/wn_controller.php?user=$1 [NC,L] # Process settings 

#What's Next Admin 
RewriteRule ^whats-next/admin/$ whats-next/wn_controller.php [NC,L] # Process profiles 
RewriteRule ^whats-next/admin$ whats-next/wn_controller.php [NC,L] # Process profiles ##WITHOUT DASH TOO. FIX SOMEDAY 

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

# END WordPress 

回答

0

嘗試0-9後立即刪除您的衝刺。

這爲我工作:^whats-next/([A-Za-z0-9._]+)$

enter image description here

相關問題